forked from enlightenment/efl
eina thread queue - fix possible deadlock
coverity pointed out a deadlock - CID 1226193. i hope this fixes it (need to wait days for a coverity re-run). tests pass and real life usage works, so i assume its ok. in theory i see no problem either.
This commit is contained in:
parent
970968daab
commit
c012e6939c
|
@ -454,14 +454,11 @@ eina_thread_queue_poll(Eina_Thread_Queue *thq, void **allocref)
|
|||
|
||||
RWLOCK_LOCK(&(thq->lock_read));
|
||||
msg = _eina_thread_queue_msg_fetch(thq, &blk);
|
||||
RWLOCK_UNLOCK(&(thq->lock_read));
|
||||
if (msg)
|
||||
{
|
||||
_eina_thread_queue_wait(thq);
|
||||
*allocref = blk;
|
||||
}
|
||||
RWLOCK_UNLOCK(&(thq->lock_read));
|
||||
if (msg)
|
||||
{
|
||||
#ifdef ATOMIC
|
||||
__atomic_sub_fetch(&(thq->pending), 1, __ATOMIC_RELAXED);
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue