Lines Matching refs:err
40 int err; in glthread_rwlock_init_multithreaded() local
42 err = pthread_rwlock_init (&lock->rwlock, NULL); in glthread_rwlock_init_multithreaded()
43 if (err != 0) in glthread_rwlock_init_multithreaded()
44 return err; in glthread_rwlock_init_multithreaded()
54 int err; in glthread_rwlock_rdlock_multithreaded() local
56 err = pthread_mutex_lock (&lock->guard); in glthread_rwlock_rdlock_multithreaded()
57 if (err != 0) in glthread_rwlock_rdlock_multithreaded()
58 return err; in glthread_rwlock_rdlock_multithreaded()
61 err = glthread_rwlock_init_multithreaded (lock); in glthread_rwlock_rdlock_multithreaded()
62 if (err != 0) in glthread_rwlock_rdlock_multithreaded()
65 return err; in glthread_rwlock_rdlock_multithreaded()
68 err = pthread_mutex_unlock (&lock->guard); in glthread_rwlock_rdlock_multithreaded()
69 if (err != 0) in glthread_rwlock_rdlock_multithreaded()
70 return err; in glthread_rwlock_rdlock_multithreaded()
80 int err; in glthread_rwlock_wrlock_multithreaded() local
82 err = pthread_mutex_lock (&lock->guard); in glthread_rwlock_wrlock_multithreaded()
83 if (err != 0) in glthread_rwlock_wrlock_multithreaded()
84 return err; in glthread_rwlock_wrlock_multithreaded()
87 err = glthread_rwlock_init_multithreaded (lock); in glthread_rwlock_wrlock_multithreaded()
88 if (err != 0) in glthread_rwlock_wrlock_multithreaded()
91 return err; in glthread_rwlock_wrlock_multithreaded()
94 err = pthread_mutex_unlock (&lock->guard); in glthread_rwlock_wrlock_multithreaded()
95 if (err != 0) in glthread_rwlock_wrlock_multithreaded()
96 return err; in glthread_rwlock_wrlock_multithreaded()
112 int err; in glthread_rwlock_destroy_multithreaded() local
116 err = pthread_rwlock_destroy (&lock->rwlock); in glthread_rwlock_destroy_multithreaded()
117 if (err != 0) in glthread_rwlock_destroy_multithreaded()
118 return err; in glthread_rwlock_destroy_multithreaded()
130 int err; in glthread_rwlock_init_multithreaded() local
132 err = pthread_mutex_init (&lock->lock, NULL); in glthread_rwlock_init_multithreaded()
133 if (err != 0) in glthread_rwlock_init_multithreaded()
134 return err; in glthread_rwlock_init_multithreaded()
135 err = pthread_cond_init (&lock->waiting_readers, NULL); in glthread_rwlock_init_multithreaded()
136 if (err != 0) in glthread_rwlock_init_multithreaded()
137 return err; in glthread_rwlock_init_multithreaded()
138 err = pthread_cond_init (&lock->waiting_writers, NULL); in glthread_rwlock_init_multithreaded()
139 if (err != 0) in glthread_rwlock_init_multithreaded()
140 return err; in glthread_rwlock_init_multithreaded()
149 int err; in glthread_rwlock_rdlock_multithreaded() local
151 err = pthread_mutex_lock (&lock->lock); in glthread_rwlock_rdlock_multithreaded()
152 if (err != 0) in glthread_rwlock_rdlock_multithreaded()
153 return err; in glthread_rwlock_rdlock_multithreaded()
164 err = pthread_cond_wait (&lock->waiting_readers, &lock->lock); in glthread_rwlock_rdlock_multithreaded()
165 if (err != 0) in glthread_rwlock_rdlock_multithreaded()
168 return err; in glthread_rwlock_rdlock_multithreaded()
178 int err; in glthread_rwlock_wrlock_multithreaded() local
180 err = pthread_mutex_lock (&lock->lock); in glthread_rwlock_wrlock_multithreaded()
181 if (err != 0) in glthread_rwlock_wrlock_multithreaded()
182 return err; in glthread_rwlock_wrlock_multithreaded()
189 err = pthread_cond_wait (&lock->waiting_writers, &lock->lock); in glthread_rwlock_wrlock_multithreaded()
190 if (err != 0) in glthread_rwlock_wrlock_multithreaded()
194 return err; in glthread_rwlock_wrlock_multithreaded()
205 int err; in glthread_rwlock_unlock_multithreaded() local
207 err = pthread_mutex_lock (&lock->lock); in glthread_rwlock_unlock_multithreaded()
208 if (err != 0) in glthread_rwlock_unlock_multithreaded()
209 return err; in glthread_rwlock_unlock_multithreaded()
237 err = pthread_cond_signal (&lock->waiting_writers); in glthread_rwlock_unlock_multithreaded()
238 if (err != 0) in glthread_rwlock_unlock_multithreaded()
241 return err; in glthread_rwlock_unlock_multithreaded()
247 err = pthread_cond_broadcast (&lock->waiting_readers); in glthread_rwlock_unlock_multithreaded()
248 if (err != 0) in glthread_rwlock_unlock_multithreaded()
251 return err; in glthread_rwlock_unlock_multithreaded()
261 int err; in glthread_rwlock_destroy_multithreaded() local
263 err = pthread_mutex_destroy (&lock->lock); in glthread_rwlock_destroy_multithreaded()
264 if (err != 0) in glthread_rwlock_destroy_multithreaded()
265 return err; in glthread_rwlock_destroy_multithreaded()
266 err = pthread_cond_destroy (&lock->waiting_readers); in glthread_rwlock_destroy_multithreaded()
267 if (err != 0) in glthread_rwlock_destroy_multithreaded()
268 return err; in glthread_rwlock_destroy_multithreaded()
269 err = pthread_cond_destroy (&lock->waiting_writers); in glthread_rwlock_destroy_multithreaded()
270 if (err != 0) in glthread_rwlock_destroy_multithreaded()
271 return err; in glthread_rwlock_destroy_multithreaded()
287 int err; in glthread_recursive_lock_init_multithreaded() local
289 err = pthread_mutexattr_init (&attributes); in glthread_recursive_lock_init_multithreaded()
290 if (err != 0) in glthread_recursive_lock_init_multithreaded()
291 return err; in glthread_recursive_lock_init_multithreaded()
292 err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); in glthread_recursive_lock_init_multithreaded()
293 if (err != 0) in glthread_recursive_lock_init_multithreaded()
296 return err; in glthread_recursive_lock_init_multithreaded()
298 err = pthread_mutex_init (lock, &attributes); in glthread_recursive_lock_init_multithreaded()
299 if (err != 0) in glthread_recursive_lock_init_multithreaded()
302 return err; in glthread_recursive_lock_init_multithreaded()
304 err = pthread_mutexattr_destroy (&attributes); in glthread_recursive_lock_init_multithreaded()
305 if (err != 0) in glthread_recursive_lock_init_multithreaded()
306 return err; in glthread_recursive_lock_init_multithreaded()
316 int err; in glthread_recursive_lock_init_multithreaded() local
318 err = pthread_mutexattr_init (&attributes); in glthread_recursive_lock_init_multithreaded()
319 if (err != 0) in glthread_recursive_lock_init_multithreaded()
320 return err; in glthread_recursive_lock_init_multithreaded()
321 err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); in glthread_recursive_lock_init_multithreaded()
322 if (err != 0) in glthread_recursive_lock_init_multithreaded()
325 return err; in glthread_recursive_lock_init_multithreaded()
327 err = pthread_mutex_init (&lock->recmutex, &attributes); in glthread_recursive_lock_init_multithreaded()
328 if (err != 0) in glthread_recursive_lock_init_multithreaded()
331 return err; in glthread_recursive_lock_init_multithreaded()
333 err = pthread_mutexattr_destroy (&attributes); in glthread_recursive_lock_init_multithreaded()
334 if (err != 0) in glthread_recursive_lock_init_multithreaded()
335 return err; in glthread_recursive_lock_init_multithreaded()
345 int err; in glthread_recursive_lock_lock_multithreaded() local
347 err = pthread_mutex_lock (&lock->guard); in glthread_recursive_lock_lock_multithreaded()
348 if (err != 0) in glthread_recursive_lock_lock_multithreaded()
349 return err; in glthread_recursive_lock_lock_multithreaded()
352 err = glthread_recursive_lock_init_multithreaded (lock); in glthread_recursive_lock_lock_multithreaded()
353 if (err != 0) in glthread_recursive_lock_lock_multithreaded()
356 return err; in glthread_recursive_lock_lock_multithreaded()
359 err = pthread_mutex_unlock (&lock->guard); in glthread_recursive_lock_lock_multithreaded()
360 if (err != 0) in glthread_recursive_lock_lock_multithreaded()
361 return err; in glthread_recursive_lock_lock_multithreaded()
377 int err; in glthread_recursive_lock_destroy_multithreaded() local
381 err = pthread_mutex_destroy (&lock->recmutex); in glthread_recursive_lock_destroy_multithreaded()
382 if (err != 0) in glthread_recursive_lock_destroy_multithreaded()
383 return err; in glthread_recursive_lock_destroy_multithreaded()
395 int err; in glthread_recursive_lock_init_multithreaded() local
397 err = pthread_mutex_init (&lock->mutex, NULL); in glthread_recursive_lock_init_multithreaded()
398 if (err != 0) in glthread_recursive_lock_init_multithreaded()
399 return err; in glthread_recursive_lock_init_multithreaded()
411 int err; in glthread_recursive_lock_lock_multithreaded() local
413 err = pthread_mutex_lock (&lock->mutex); in glthread_recursive_lock_lock_multithreaded()
414 if (err != 0) in glthread_recursive_lock_lock_multithreaded()
415 return err; in glthread_recursive_lock_lock_multithreaded()
534 int err; in glthread_recursive_lock_init_multithreaded() local
536 err = mutex_init (&lock->mutex, USYNC_THREAD, NULL); in glthread_recursive_lock_init_multithreaded()
537 if (err != 0) in glthread_recursive_lock_init_multithreaded()
538 return err; in glthread_recursive_lock_init_multithreaded()
550 int err; in glthread_recursive_lock_lock_multithreaded() local
552 err = mutex_lock (&lock->mutex); in glthread_recursive_lock_lock_multithreaded()
553 if (err != 0) in glthread_recursive_lock_lock_multithreaded()
554 return err; in glthread_recursive_lock_lock_multithreaded()
596 int err; in glthread_once_multithreaded() local
600 err = mutex_lock (&once_control->mutex); in glthread_once_multithreaded()
601 if (err != 0) in glthread_once_multithreaded()
602 return err; in glthread_once_multithreaded()