]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap_r/thr_cthreads.c
Clarify error string, add comment
[openldap] / libraries / libldap_r / thr_cthreads.c
index ecffe40e60f8eea2a8fcd5aa825e5668fb71e490..8d3949aa989aba76efaf07bf3df019538b2bcd0f 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
  * All rights reserved.
@@ -11,9 +12,9 @@
 /* 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"
 
 /***********************************************************************
  *                                                                     *
  *                                                                     *
  ***********************************************************************/
 
+int
+ldap_pvt_thread_initialize( void )
+{
+       return 0;
+}
+
+int
+ldap_pvt_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 );    
@@ -41,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;
@@ -63,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 );
 }
 
@@ -98,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 );
 }
 
@@ -113,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;