Commit 08a0d366073eacf800027725891c2f668f2f0144

Azat Khuzhin 2018-02-27T21:12:14

Fix base unlocking in event_del() if event_base_set() runned in another thread Image next situation: T1: T2: event_del_() lock the event.ev_base.th_base_lock event_del_nolock_() event_set_base() unlock the event.ev_base.th_base_lock In this case we will unlock the wrong base after event_del_nolock_() returns, and deadlock is likely to happens, since event_base_set() do not check any mutexes (due to it is possible to do this only if event is not inserted anywhere). So event_del_() has to cache the base before removing the event, and cached base.th_base_lock after.