Lines Matching refs:ret
46 int ret = pthread_mutex_trylock (&mutex); in cleanup() local
47 if (ret != EDEADLK && ret != EBUSY) in cleanup()
49 printf ("mutex not locked in cleanup %d\n", ret); in cleanup()
59 int i, ret = 0; in signaller() local
64 if ((ret = pthread_mutex_lock (&mutex)) != 0) in signaller()
67 printf ("signaller:mutex_lock failed: %s\n", strerror (ret)); in signaller()
70 if ((ret = pthread_cond_signal (&cond)) != 0) in signaller()
73 printf ("signaller:signal failed: %s\n", strerror (ret)); in signaller()
76 if ((ret = pthread_mutex_unlock (&mutex)) != 0) in signaller()
79 printf ("signaller:mutex_unlock failed: %s\n", strerror (ret)); in signaller()
89 if ((ret = pthread_mutex_unlock (&mutex)) != 0) in signaller()
90 printf ("signaller:mutex_unlock[2] failed: %s\n", strerror (ret)); in signaller()
97 int i, ret = 0; in waiter() local
103 if ((ret = pthread_mutex_lock (&mutex)) != 0) in waiter()
106 printf ("waiter[%u]:mutex_lock failed: %s\n", seq, strerror (ret)); in waiter()
111 if ((ret = pthread_cond_wait (&cond, &mutex)) != 0) in waiter()
114 printf ("waiter[%u]:wait failed: %s\n", seq, strerror (ret)); in waiter()
118 if ((ret = pthread_mutex_unlock (&mutex)) != 0) in waiter()
121 printf ("waiter[%u]:mutex_unlock failed: %s\n", seq, strerror (ret)); in waiter()
132 if ((ret = pthread_mutex_unlock (&mutex)) != 0) in waiter()
133 printf ("waiter:mutex_unlock[2] failed: %s\n", strerror (ret)); in waiter()
140 int i, ret; in timed_waiter() local
148 if ((ret = clock_gettime(CLOCK_REALTIME, &ts)) != 0) in timed_waiter()
156 if ((ret = pthread_mutex_lock (&mutex)) != 0) in timed_waiter()
159 printf ("waiter[%u]:mutex_lock failed: %s\n", seq, strerror (ret)); in timed_waiter()
165 if ((ret = pthread_cond_timedwait (&cond, &mutex, &ts)) != 0) in timed_waiter()
168 printf ("waiter[%u]:timedwait failed: %s\n", seq, strerror (ret)); in timed_waiter()
171 if ((ret = pthread_mutex_unlock (&mutex)) != 0) in timed_waiter()
174 printf ("waiter[%u]:mutex_unlock failed: %s\n", seq, strerror (ret)); in timed_waiter()
185 if ((ret = pthread_mutex_unlock (&mutex)) != 0) in timed_waiter()
186 printf ("waiter[%u]:mutex_unlock[2] failed: %s\n", seq, strerror (ret)); in timed_waiter()
196 int i, j, ret = 0; in do_test_wait() local
201 if ((ret = pthread_mutexattr_init (&attr)) != 0) in do_test_wait()
203 printf ("mutexattr_init failed: %s\n", strerror (ret)); in do_test_wait()
207 if ((ret = pthread_mutexattr_setprotocol (&attr, in do_test_wait()
210 printf ("mutexattr_setprotocol failed: %s\n", strerror (ret)); in do_test_wait()
214 if ((ret = pthread_cond_init (&cond, NULL)) != 0) in do_test_wait()
216 printf ("cond_init failed: %s\n", strerror (ret)); in do_test_wait()
220 if ((ret = pthread_mutex_init (&mutex, &attr)) != 0) in do_test_wait()
222 printf ("mutex_init failed: %s\n", strerror (ret)); in do_test_wait()
227 if ((ret = pthread_create (&w[j], NULL, in do_test_wait()
230 printf ("waiter[%d]: create failed: %s\n", j, strerror (ret)); in do_test_wait()
234 if ((ret = pthread_create (&s, NULL, signaller, NULL)) != 0) in do_test_wait()
236 printf ("signaller: create failed: %s\n", strerror (ret)); in do_test_wait()
244 if ((ret = pthread_join (w[j], &thr_ret)) != 0) in do_test_wait()
246 printf ("waiter[%d]: join failed: %s\n", j, strerror (ret)); in do_test_wait()
252 ret = 1; in do_test_wait()
260 if ((ret = pthread_join (s, &thr_ret)) != 0) in do_test_wait()
262 printf ("signaller: join failed: %s\n", strerror (ret)); in do_test_wait()
268 ret = 1; in do_test_wait()
274 return ret; in do_test_wait()
280 int ret = do_test_wait (waiter); in do_test() local
282 if (ret) in do_test()
283 return ret; in do_test()