eina thread queue - ensure blocks cannot be freed until lock+unlock

just in case... check blocks cannot be freed until locked and unlocked
just in case someone still is holding a lock.
This commit is contained in:
Carsten Haitzler 2016-08-05 23:51:03 +09:00
parent 0a243671c7
commit 26db5d5056
1 changed files with 4 additions and 0 deletions

View File

@ -137,8 +137,12 @@ _eina_thread_queue_msg_block_new(int size)
static void
_eina_thread_queue_msg_block_real_free(Eina_Thread_Queue_Msg_Block *blk)
{
eina_lock_take(&(blk->lock_non_0_ref));
eina_lock_release(&(blk->lock_non_0_ref));
eina_lock_free(&(blk->lock_non_0_ref));
#ifndef ATOMIC
eina_lock_take(&(blk->lock_ref));
eina_lock_release(&(blk->lock_ref));
eina_spinlock_free(&(blk->lock_ref));
#endif
free(blk);