Lines Matching refs:td

158 	testdata_t * td = (testdata_t *)arg;
161 ret = pthread_mutex_lock(&(td->mtx));
164 td->status = ret;
169 td->ctrl = 1;
172 ret = clock_gettime(td->cid, &ts);
175 td->status = ret;
187 ret = pthread_cond_timedwait(&(td->cnd), &(td->mtx), &ts);
188 td->ctrl = 2;
189 } while ((ret == 0) && (td->bool == 0));
191 td->ctrl = 3;
195 td->status = ret;
200 ret = pthread_mutex_trylock(&(td->mtx));
201 if (td->type == PTHREAD_MUTEX_RECURSIVE)
208 td->status = ret;
211 ret = pthread_mutex_unlock(&(td->mtx));
214 td->status = ret;
222 td->status = -1;
227 td-> status = ret;
235 ret = pthread_mutex_unlock(&(td->mtx));
238 td->status=ret;
243 td->ctrl = 4;
254 testdata_t * td;
299 td = &alternativ;
343 td = (testdata_t *) mmaped;
427 ret = pthread_mutex_init(&(td->mtx), &ma);
432 ret = pthread_cond_init(&(td->cnd), &ca);
438 ret = pthread_condattr_getclock(&ca, &(td->cid));
442 td->cid = CLOCK_REALTIME;
445 ret = pthread_mutexattr_gettype(&ma, &(td->type));
449 td->ctrl=0;
450 td->bool=0;
451 td->status=0;
471 if (tf((void *)td) != NULL)
486 ret = pthread_create(&child_th, NULL, tf, td);
494 ret = pthread_mutex_lock(&(td->mtx));
497 while ((td->ctrl == 0) && (td->status == 0))
499 ret = pthread_mutex_unlock(&(td->mtx));
502 ret = pthread_mutex_lock(&(td->mtx));
506 if ((td->ctrl == 2) && (td->status == 0)) /* Spurious wakeups hapenned */
509 td->ctrl = 1;
512 if (td->ctrl == 1)/* The child is inside the cond timedwait */
514 ret = pthread_cond_signal(&(td->cnd));
520 if (td->ctrl != 1)
526 td->bool=1;
530 ret = pthread_mutex_unlock(&(td->mtx));
546 UNRESOLVED( td->status , "Child process was killed");
555 UNRESOLVED( td->status, "Child process was neither killed nor exited");
572 ret = pthread_cond_destroy(&(td->cnd));
575 ret = pthread_mutex_destroy(&(td->mtx));