]> git.sur5r.net Git - openldap/blob - libraries/libldap_r/thr_stub.c
Define env.variable SLAPD_DEBUG to override the default debug level
[openldap] / libraries / libldap_r / thr_stub.c
1 /*
2  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
3  * All rights reserved.
4  *
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.
9  */
10
11 /* thr_stub.c - stubs for the threads */
12
13 #include "portable.h"
14 #include "ldap_pvt_thread.h"
15
16 #if defined( NO_THREADS )
17
18 /***********************************************************************
19  *                                                                     *
20  * no threads package defined for this system - fake ok returns from   *
21  * all threads routines (making it single-threaded).                   *
22  *                                                                     *
23  ***********************************************************************/
24
25 int
26 ldap_pvt_thread_initialize( void )
27 {
28         return 0;
29 }
30
31 static void* ldap_int_status = NULL;
32
33 int 
34 ldap_pvt_thread_create( ldap_pvt_thread_t * thread, 
35         int detach,
36         void *(*start_routine)(void *),
37         void *arg)
38 {
39         if( ! detach ) ldap_int_status = NULL;
40         start_routine( arg );
41         return 0;
42 }
43
44 void 
45 ldap_pvt_thread_exit( void *retval )
46 {
47         if( retval != NULL ) {
48                 ldap_int_status = retval;
49         }
50         return;
51 }
52
53 int 
54 ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **status )
55 {
56         if(status != NULL) *status = ldap_int_status;
57         return 0;
58 }
59
60 int 
61 ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
62 {
63         return 0;
64 }
65
66 int 
67 ldap_pvt_thread_yield( void )
68 {
69         return 0;
70 }
71
72 int 
73 ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
74 {
75         return 0;
76 }
77
78 int 
79 ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
80 {
81         return 0;
82 }
83
84 int 
85 ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
86 {
87         return 0;
88 }
89
90 int 
91 ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
92 {
93         return 0;
94 }
95
96 int 
97 ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
98                           ldap_pvt_thread_mutex_t *mutex )
99 {
100         return 0;
101 }
102
103 int 
104 ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
105 {
106         return 0;
107 }
108
109 int 
110 ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
111 {
112         return 0;
113 }
114
115 int 
116 ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
117 {
118         return 0;
119 }
120
121 int 
122 ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
123 {
124         return 0;
125 }
126
127 #endif /* NO_THREADS */