Do not short-cut the mutex protecting node->subreq.done
A follow-up issue has been reported in #13: Assert error in Lck_Delete(), cache/cache_lck.c line 309: Condition((pthread_mutex_destroy(&ilck->mtx)) == 0) not true. triggered from Lck_Delete(&bytes_tree->nodes_lock) at the bottom of bytes_tree_fini(). Assuming everything else working correctly, the only scenario I can see the moment is that we see the node->subreq.done == 1 earlier than Lck_Unlock() returned in vped_task(). In this case, we could advance to destroying the lock while the other thread still holds it. The other use case of the shared lock is in fini_final(), where we already go through an explicit lock/unlock. Hopefully fixes #13 for real
Showing