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