This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 6/6] nptl/tst-abstime: Use libsupport
- From: Florian Weimer <fweimer at redhat dot com>
- To: Mike Crowe <mac at mcrowe dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 05 Apr 2019 13:02:35 +0200
- Subject: Re: [PATCH 6/6] nptl/tst-abstime: Use libsupport
- References: <cover.13c2d68f411f9010956e8e52edfbe168964e1e5c.1553797867.git-series.mac@mcrowe.com> <cover.13c2d68f411f9010956e8e52edfbe168964e1e5c.1553797867.git-series.mac@mcrowe.com> <2321a48f07ac0f4822b2fb14e86ff34f89c1007e.1553797867.git-series.mac@mcrowe.com>
* 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