__pthread_cleanup_pop (&buffer, 0);
- if (__glibc_unlikely (err == ETIMEDOUT))
+ if (__glibc_unlikely (err == ETIMEDOUT || err == EOVERFLOW))
{
__condvar_dec_grefs (cond, g, private);
/* If we timed out, we effectively cancel waiting. Note that
__condvar_quiesce_and_switch_g1 and us trying to acquire
the lock during cancellation is not possible. */
__condvar_cancel_waiting (cond, seq, g, private);
- result = ETIMEDOUT;
+ result = err;
goto done;
}
else
oldval, clockid, abstime,
PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
/* The futex call timed out. */
- if (err == ETIMEDOUT)
+ if (err == ETIMEDOUT || err == EOVERFLOW)
return err;
/* Reload current lock value. */
oldval = mutex->__data.__lock;
int e = __futex_abstimed_wait64 (
(unsigned int *) &mutex->__data.__lock, ceilval | 2,
clockid, abstime, PTHREAD_MUTEX_PSHARED (mutex));
- if (e == ETIMEDOUT)
- return ETIMEDOUT;
+ if (e == ETIMEDOUT || e == EOVERFLOW)
+ return e;
}
}
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
private);
/* We ignore EAGAIN and EINTR. On time-outs, we can just
return because we don't need to clean up anything. */
- if (err == ETIMEDOUT)
+ if (err == ETIMEDOUT || err == EOVERFLOW)
return err;
}
/* It makes sense to not break out of the outer loop here
int err = __futex_abstimed_wait64 (&rwlock->__data.__wrphase_futex,
1 | PTHREAD_RWLOCK_FUTEX_USED,
clockid, abstime, private);
- if (err == ETIMEDOUT)
+ if (err == ETIMEDOUT || err == EOVERFLOW)
{
/* If we timed out, we need to unregister. If no read phase
has been installed while we waited, we can just decrement
if (atomic_compare_exchange_weak_relaxed
(&rwlock->__data.__readers, &r,
r - (1 << PTHREAD_RWLOCK_READER_SHIFT)))
- return ETIMEDOUT;
+ return err;
/* TODO Back-off. */
}
/* Use the acquire MO fence to mirror the steps taken in the
int err = __futex_abstimed_wait64 (&rwlock->__data.__writers_futex,
1 | PTHREAD_RWLOCK_FUTEX_USED,
clockid, abstime, private);
- if (err == ETIMEDOUT)
+ if (err == ETIMEDOUT || err == EOVERFLOW)
{
if (prefer_writer)
{
}
/* We cleaned up and cannot have stolen another waiting writer's
futex wake-up, so just return. */
- return ETIMEDOUT;
+ return err;
}
/* If we got interrupted (EINTR) or the futex word does not have the
expected value (EAGAIN), retry after reloading __readers. */
int err = __futex_abstimed_wait64 (&rwlock->__data.__wrphase_futex,
PTHREAD_RWLOCK_FUTEX_USED,
clockid, abstime, private);
- if (err == ETIMEDOUT)
+ if (err == ETIMEDOUT || err == EOVERFLOW)
{
if (rwlock->__data.__flags != PTHREAD_RWLOCK_PREFER_READER_NP)
{
if ((wf & PTHREAD_RWLOCK_FUTEX_USED) != 0)
futex_wake (&rwlock->__data.__writers_futex,
1, private);
- return ETIMEDOUT;
+ return err;
}
/* TODO Back-off. */
}