2 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
5 * Redistribution and use in source and binary forms are permitted only
6 * as authorized by the OpenLDAP Public License. A copy of this
7 * license is available at http://www.OpenLDAP.org/license.html or
8 * in file LICENSE in the top-level directory of the distribution.
11 /* thr_stub.c - stubs for the threads */
14 #include "ldap_pvt_thread.h"
16 #if defined( NO_THREADS )
18 /***********************************************************************
20 * no threads package defined for this system - fake ok returns from *
21 * all threads routines (making it single-threaded). *
23 ***********************************************************************/
26 ldap_pvt_thread_initialize( void )
31 static void* ldap_int_status = NULL;
34 ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
36 void *(*start_routine)(void *),
39 if( ! detach ) ldap_int_status = NULL;
45 ldap_pvt_thread_exit( void *retval )
47 if( retval != NULL ) {
48 ldap_int_status = retval;
54 ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **status )
56 if(status != NULL) *status = ldap_int_status;
61 ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
67 ldap_pvt_thread_yield( void )
73 ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
79 ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
85 ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
86 ldap_pvt_thread_mutex_t *mutex )
92 ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
98 ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
104 ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
110 ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
115 #endif /* NO_THREADS */