]> granicus.if.org Git - libevent/commit
Fix some race conditions in persistent events and event_reinit
authorNick Mathewson <nickm@torproject.org>
Tue, 23 Feb 2010 20:14:57 +0000 (15:14 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 23 Feb 2010 20:20:33 +0000 (15:20 -0500)
commite2642f0a880dcee81114c1c25766f0380672ee30
treefbd67f77278cbdba519f0ab168f636168c23b56b
parent4b37e6a5eab3d85e01920a679201d1e3a7ed2aa4
Fix some race conditions in persistent events and event_reinit

I found these by adding an EVENT_BASE_ASSERT_LOCKED() call to most
of the functions in event.c that can only be called while holding
the lock.

event_reinit() never grabbed the lock, but it needed to.

event_persist_closure accessed the base to call event_add_internal()
and gettime() when its caller had already dropped the lock.

event_pending() called gettime() without grabbing the lock.
event.c