Use a mutex to protect the count of open sockets.
commitc36efb0c451b3cc55d6ebf634af451f9d0b542b9
authorNick Mathewson <nickm@torproject.org>
Tue, 12 May 2009 20:17:32 +0000 (12 16:17 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 13 May 2009 13:38:48 +0000 (13 09:38 -0400)
tree168d215b6eb227ab8186f08ec00690a36826e599
parenta28215a150818b11e128f5f5aeb44e53a40d5af7
Use a mutex to protect the count of open sockets.

This matters because a cpuworker can close its socket when it
finishes.  Cpuworker typically runs in another thread, so without a
lock here, we can have a race condition and get confused about how
many sockets are open.  Possible fix for bug 939.
ChangeLog
src/common/compat.c