I'm running my application (using libevent 1.4.8) through the Valgrind tool
Helgrind to help make sure I have no race conditions. It brought my
attention to the following line of code in event_base_loop (line 475 in the
current release, line 698 in trunk), that after inspection is confusing to
me.

if (&base->sig.ev_signal_added)
    evsignal_base = base;

If I'm reading this correctly, the statement "&base->sig.ev_signal_added"
evaluates to an address, so the condition is always true. Am I missing
something? Is this the desired behavior of this statement?

(As background, the issue that Helgrind reports is triggered by the fact
that I have two threads, each with their own event loop run by
event_base_loop. Since evsignal_base is shared between the two threads (it's
global) they both set it to their thread-local base, and Helgrind
accordingly reports the possibility of a race condition.)
 
Thanks!
Lance

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to