LibC: lock mutex when pthread_cond_timedwait times out
This commit is contained in:
parent
fa7b58057c
commit
57c9f5a8a8
|
@ -1164,7 +1164,10 @@ int pthread_cond_timedwait(pthread_cond_t* __restrict cond, pthread_mutex_t* __r
|
||||||
while (BAN::atomic_load(block.signaled) == 0)
|
while (BAN::atomic_load(block.signaled) == 0)
|
||||||
{
|
{
|
||||||
if (has_timed_out(abstime, cond->attr.clock))
|
if (has_timed_out(abstime, cond->attr.clock))
|
||||||
|
{
|
||||||
|
pthread_mutex_lock(mutex);
|
||||||
return ETIMEDOUT;
|
return ETIMEDOUT;
|
||||||
|
}
|
||||||
sched_yield();
|
sched_yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue