X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libraries%2Flibldap_r%2Fthr_cthreads.c;h=8e9049c7b1927d489abf5600a63996b8feed8ad2;hb=ab3be5d76d8e85e4adabd671567eba405d14869f;hp=8a308e75b39cfa45e3baee5c5debef9c292cefdd;hpb=0c1cb93c69ead8e2eadef1b70daa54125455ec78;p=openldap diff --git a/libraries/libldap_r/thr_cthreads.c b/libraries/libldap_r/thr_cthreads.c index 8a308e75b3..8e9049c7b1 100644 --- a/libraries/libldap_r/thr_cthreads.c +++ b/libraries/libldap_r/thr_cthreads.c @@ -1,9 +1,20 @@ -/* thrmach.c - wrapper for mach cthreads */ +/* $OpenLDAP$ */ +/* + * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted only + * as authorized by the OpenLDAP Public License. A copy of this + * license is available at http://www.OpenLDAP.org/license.html or + * in file LICENSE in the top-level directory of the distribution. + */ + +/* thr_cthreads.c - wrapper for mach cthreads */ #include "portable.h" -#include "ldap_pvt_thread.h" #if defined( HAVE_MACH_CTHREADS ) +#include "ldap_pvt_thread.h" /*********************************************************************** * * @@ -12,10 +23,22 @@ * * ***********************************************************************/ +int +ldap_int_thread_initialize( void ) +{ + return 0; +} + +int +ldap_int_thread_destroy( void ) +{ + return 0; +} + int ldap_pvt_thread_create( ldap_pvt_thread_t * thread, - ldap_pvt_thread_attr_t *attr, - void *(*start_routine)( void *), void *arg) + int detach, + void *(*start_routine)( void *), void *arg) { *thread = cthread_fork( (cthread_fn_t) start_routine, arg); return ( *thread == NULL ? -1 : 0 ); @@ -31,7 +54,7 @@ int ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **thread_return ) { void *status; - status = (void *) cthread_join ( tid ); + status = (void *) cthread_join ( thread ); if (thread_return != NULL) { *thread_return = status; @@ -53,30 +76,16 @@ ldap_pvt_thread_yield( void ) } int -ldap_pvt_thread_attr_init( ldap_pvt_thread_attr_t *attr ) +ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond ) { - *attr = 0; - return( 0 ); -} - -int -ldap_pvt_thread_attr_destroy( ldap_pvt_thread_attr_t *attr ) -{ - return( 0 ); -} - -int -ldap_pvt_thread_attr_setdetachstate( ldap_pvt_thread_attr_t *attr, int dstate ) -{ - *attr = dstate; + condition_init( cond ); return( 0 ); } int -ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond, - ldap_pvt_thread_condattr_t *attr ) +ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond ) { - condition_init( cond ); + condition_clear( cond ); return( 0 ); } @@ -88,9 +97,9 @@ ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond ) } int -ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cv ) +ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond ) { - condition_broadcast( cv ); + condition_broadcast( cond ); return( 0 ); } @@ -103,8 +112,7 @@ ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond, } int -ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex, - ldap_pvt_thread_mutexattr_t *attr ) +ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex ) { mutex_init( mutex ); mutex->name = NULL;