]> git.sur5r.net Git - openldap/blob - libraries/libldap_r/thr_stub.c
7cd8e5f6be430721bed54e5dd909dd9156b79c19
[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 int
32 ldap_pvt_thread_destroy( void )
33 {
34         return 0;
35 }
36
37 static void* ldap_int_status = NULL;
38
39 int 
40 ldap_pvt_thread_create( ldap_pvt_thread_t * thread, 
41         int detach,
42         void *(*start_routine)(void *),
43         void *arg)
44 {
45         if( ! detach ) ldap_int_status = NULL;
46         start_routine( arg );
47         return 0;
48 }
49
50 void 
51 ldap_pvt_thread_exit( void *retval )
52 {
53         if( retval != NULL ) {
54                 ldap_int_status = retval;
55         }
56         return;
57 }
58
59 int 
60 ldap_pvt_thread_join( ldap_pvt_thread_t thread, void **status )
61 {
62         if(status != NULL) *status = ldap_int_status;
63         return 0;
64 }
65
66 int 
67 ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
68 {
69         return 0;
70 }
71
72 int 
73 ldap_pvt_thread_yield( void )
74 {
75         return 0;
76 }
77
78 int 
79 ldap_pvt_thread_cond_init( ldap_pvt_thread_cond_t *cond )
80 {
81         return 0;
82 }
83
84 int 
85 ldap_pvt_thread_cond_destroy( ldap_pvt_thread_cond_t *cond )
86 {
87         return 0;
88 }
89
90 int 
91 ldap_pvt_thread_cond_signal( ldap_pvt_thread_cond_t *cond )
92 {
93         return 0;
94 }
95
96 int 
97 ldap_pvt_thread_cond_broadcast( ldap_pvt_thread_cond_t *cond )
98 {
99         return 0;
100 }
101
102 int 
103 ldap_pvt_thread_cond_wait( ldap_pvt_thread_cond_t *cond,
104                           ldap_pvt_thread_mutex_t *mutex )
105 {
106         return 0;
107 }
108
109 int 
110 ldap_pvt_thread_mutex_init( ldap_pvt_thread_mutex_t *mutex )
111 {
112         return 0;
113 }
114
115 int 
116 ldap_pvt_thread_mutex_destroy( ldap_pvt_thread_mutex_t *mutex )
117 {
118         return 0;
119 }
120
121 int 
122 ldap_pvt_thread_mutex_lock( ldap_pvt_thread_mutex_t *mutex )
123 {
124         return 0;
125 }
126
127 int 
128 ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_t *mutex )
129 {
130         return 0;
131 }
132
133 #endif /* NO_THREADS */