Add semaphore tests, fix sem_destroy.

Bug: https://code.google.com/p/android/issues/detail?id=76088
Change-Id: I4a0561b23e90312384d40a1c804ca64ee98f4066
This commit is contained in:
Elliott Hughes
2014-09-18 16:11:59 -07:00
parent adc01348ee
commit 04303f5a8a
17 changed files with 567 additions and 550 deletions

View File

@@ -163,12 +163,12 @@ int __pthread_cond_timedwait_relative(pthread_cond_t* cond, pthread_mutex_t* mut
}
__LIBC_HIDDEN__
int __pthread_cond_timedwait(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* abstime, clockid_t clock) {
int __pthread_cond_timedwait(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* abs_ts, clockid_t clock) {
timespec ts;
timespec* tsp;
if (abstime != NULL) {
if (__timespec_from_absolute(&ts, abstime, clock) < 0) {
if (abs_ts != NULL) {
if (!timespec_from_absolute_timespec(ts, *abs_ts, clock)) {
return ETIMEDOUT;
}
tsp = &ts;