This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 6/6] nptl/tst-abstime: Use libsupport


* Mike Crowe:

>    pthread_mutex_lock (&m1);
>    pthread_rwlock_wrlock (&rw1);
>    pthread_rwlock_rdlock (&rw2);
>    pthread_mutex_lock (&m2);
>    if (pthread_create (&pth, 0, th, 0) != 0)
> -    {
> -      puts ("cannot create thread");
> -      return 1;
> -    }
> -  r = pthread_cond_timedwait (&c, &m2, &t);
> -  if (r != ETIMEDOUT)
> -    {
> -      puts ("pthread_cond_timedwait did not return ETIMEDOUT");
> -      res = 1;
> -    }
> -  void *thres;
> -  pthread_join (pth, &thres);
> -  return res | (thres != NULL);
> +    FAIL_RET ("cannot create thread");
> +  TEST_COMPARE (pthread_cond_timedwait (&c, &m2, &t), ETIMEDOUT);
> +  pthread_join (pth, NULL);

The pthread_* functions should use the xpthread_* variants.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]