-/* 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"
/***********************************************************************
* *
* *
***********************************************************************/
+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 );
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;
}
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 );
}
}
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 );
}
}
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;