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 */
15 #if defined( NO_THREADS )
17 #include "ldap_pvt_thread.h"
19 /***********************************************************************
21 * no threads package defined for this system - fake ok returns from *
22 * all threads routines (making it single-threaded). *
24 ***********************************************************************/
27 ldap_pvt_thread_initialize( void )
33 ldap_pvt_thread_destroy( void )
38 static void* ldap_int_status = NULL;
41 ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
43 void *(*start_routine)(void *),
46 if( ! detach ) ldap_int_status = NULL;
52 ldap_pvt_thread_exit( void *retval )
54 if( retval != NULL ) {
55 ldap_int_status = retval;
61 ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **status )
63 if(status != NULL) *status = ldap_int_status;
68 ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
74 ldap_pvt_thread_yield( void )
80 ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
86 ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
92 ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
98 ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
104 ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
105 ldap_pvt_thread_mutex_t *mutex )
111 ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
117 ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
123 ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
129 ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
134 #endif /* NO_THREADS */