35 pthread_mutex_init (&p->mutex, 0);
38 InitializeCriticalSection (&p->mutex);
48 fprintf (stderr,
"zebra_mutex_destroy. state = %d\n", p->
state);
51 pthread_mutex_destroy (&p->mutex);
54 DeleteCriticalSection (&p->mutex);
63 fprintf (stderr,
"zebra_mutex_lock. state = %d\n", p->
state);
66 pthread_mutex_lock (&p->mutex);
69 EnterCriticalSection (&p->mutex);
78 fprintf (stderr,
"zebra_mutex_unlock. state = %d\n", p->
state);
81 pthread_mutex_unlock (&p->mutex);
84 LeaveCriticalSection (&p->mutex);
94 pthread_mutex_init (&p->mutex, 0);
95 pthread_cond_init (&p->lock_free, 0);
104 #if YAZ_POSIX_THREADS
105 pthread_mutex_destroy (&p->mutex);
106 pthread_cond_destroy (&p->lock_free);
113 #if YAZ_POSIX_THREADS
114 pthread_mutex_lock (& p->mutex);
116 pthread_cond_wait (&p->lock_free, &p->mutex);
118 pthread_mutex_unlock(&p->mutex);
125 #if YAZ_POSIX_THREADS
126 pthread_mutex_lock (&p->mutex);
128 pthread_cond_wait (&p->lock_free, &p->mutex);
130 pthread_mutex_unlock (&p->mutex);
137 #if YAZ_POSIX_THREADS
138 pthread_mutex_lock (&p->mutex);
141 pthread_mutex_unlock (&p->mutex);
148 pthread_cond_signal (&p->lock_free);
149 pthread_mutex_unlock (&p->mutex);
157 #if YAZ_POSIX_THREADS
158 pthread_mutex_lock (&p->mutex);
161 pthread_mutex_unlock (&p->mutex);
167 pthread_cond_broadcast(&p->lock_free);
168 pthread_mutex_unlock(&p->mutex);
176 #if YAZ_POSIX_THREADS
177 pthread_cond_init (&p->cond, 0);
178 pthread_mutex_init (&p->mutex, 0);
185 #if YAZ_POSIX_THREADS
186 pthread_cond_destroy (&p->cond);
187 pthread_mutex_destroy (&p->mutex);
194 #if YAZ_POSIX_THREADS
195 return pthread_mutex_lock (&p->mutex);
203 #if YAZ_POSIX_THREADS
204 return pthread_mutex_unlock (&p->mutex);
212 #if YAZ_POSIX_THREADS
213 return pthread_cond_wait (&p->cond, &p->mutex);
221 #if YAZ_POSIX_THREADS
222 return pthread_cond_signal (&p->cond);
int zebra_mutex_cond_init(Zebra_mutex_cond *p)
int zebra_mutex_unlock(Zebra_mutex *p)
int zebra_mutex_init(Zebra_mutex *p)
int zebra_mutex_cond_lock(Zebra_mutex_cond *p)
int zebra_lock_rdwr_rlock(Zebra_lock_rdwr *p)
int zebra_lock_rdwr_wlock(Zebra_lock_rdwr *p)
int zebra_mutex_cond_unlock(Zebra_mutex_cond *p)
int zebra_lock_rdwr_destroy(Zebra_lock_rdwr *p)
int zebra_mutex_cond_destroy(Zebra_mutex_cond *p)
int zebra_lock_rdwr_wunlock(Zebra_lock_rdwr *p)
int zebra_lock_rdwr_runlock(Zebra_lock_rdwr *p)
int zebra_mutex_lock(Zebra_mutex *p)
int zebra_mutex_cond_signal(Zebra_mutex_cond *p)
int zebra_mutex_cond_wait(Zebra_mutex_cond *p)
int zebra_lock_rdwr_init(Zebra_lock_rdwr *p)
int zebra_mutex_destroy(Zebra_mutex *p)