summaryrefslogtreecommitdiff
path: root/poll.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-15 01:40:02 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-15 01:40:02 -0400
commit95a7d418ab4ff332bc299813e6fc83c9be4ed0ec (patch)
tree03f93c6e972cdf3c54d8a5219a86203881cdaf24 /poll.c
parent720bd933c8a4e9f0b850be075e055eea98767665 (diff)
downloadlibevent-95a7d418ab4ff332bc299813e6fc83c9be4ed0ec.tar.gz
Make default signal backend fully threadsafe
Jason Toffaletti discovered with helgrind that our signal handler was messing with evsig_base, which can be set from lots of places in the code. Ordinarly, we'd just stick a lock on it, except that it is illegal (and genuinely error-prone) to call pthread_mutex_acquire() from inside a signal handler. The solution is to only store the fd we write to in a static variable, write the signal number to the fd, and put evsig_cb in charge of activating signal events. I have no idea how we'll cope if we want to enable this to handle siginfo (where available) in the future.
Diffstat (limited to 'poll.c')
0 files changed, 0 insertions, 0 deletions