Lines Matching defs:td

156 	testdata_t * td = (testdata_t *)arg;
159 ret = pthread_mutex_lock(&(td->mtx));
162 td->status = ret;
167 td->ctrl = 1;
172 ret = pthread_cond_wait(&(td->cnd), &(td->mtx));
173 td->ctrl = 2;
174 } while ((ret == 0) && (td->bool == 0));
176 td->ctrl = 3;
180 td->status = ret;
185 ret = pthread_mutex_trylock(&(td->mtx));
186 if (td->type == PTHREAD_MUTEX_RECURSIVE)
193 td->status = ret;
196 ret = pthread_mutex_unlock(&(td->mtx));
199 td->status = ret;
207 td->status = -1;
212 td-> status = ret;
220 ret = pthread_mutex_unlock(&(td->mtx));
223 td->status=ret;
228 td->ctrl = 4;
239 testdata_t * td;
284 td = &alternativ;
328 td = (testdata_t *) mmaped;
412 ret = pthread_mutex_init(&(td->mtx), &ma);
417 ret = pthread_cond_init(&(td->cnd), &ca);
423 ret = pthread_condattr_getclock(&ca, &(td->cid));
427 td->cid = CLOCK_REALTIME;
430 ret = pthread_mutexattr_gettype(&ma, &(td->type));
434 td->ctrl=0;
435 td->bool=0;
436 td->status=0;
456 if (tf((void *)td) != NULL)
471 ret = pthread_create(&child_th, NULL, tf, td);
479 ret = pthread_mutex_lock(&(td->mtx));
482 while ((td->ctrl == 0) && (td->status == 0))
484 ret = pthread_mutex_unlock(&(td->mtx));
487 ret = pthread_mutex_lock(&(td->mtx));
491 if ((td->ctrl == 2) && (td->status == 0)) /* Spurious wakeups hapenned */
494 td->ctrl = 1;
497 if (td->ctrl == 1)/* The child is inside the cond wait */
499 ret = pthread_cond_signal(&(td->cnd));
505 if (td->ctrl != 1)
511 td->bool=1;
515 ret = pthread_mutex_unlock(&(td->mtx));
531 UNRESOLVED( td->status , "Child process was killed");
540 UNRESOLVED( td->status, "Child process was neither killed nor exited");
557 ret = pthread_cond_destroy(&(td->cnd));
560 ret = pthread_mutex_destroy(&(td->mtx));