summaryrefslogtreecommitdiff
path: root/src/common/compat_threads.c
AgeCommit message (Collapse)Author
2016-02-27Update the copyright year.Nick Mathewson
2016-02-27Add a brief file-level description for everything in src/commonNick Mathewson
2015-08-07Check for EINTR correctly on windowsNick Mathewson
(even though these are nonblocking calls and EINTR shouldn't be possible). Also, log what error we're seing if drain_fn fails.
2015-01-30Fix: check r < 0 before checking errnoDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-30Fix possible infinite loop on pipe/sock_drain()David Goulet
If the returned value of read/recv is 0 (meaning EOF), we'll end up in an infinite loop (active wait) until something is written on the pipe which is not really what we want here especially because those functions are called from the main thread. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-22fix some warnings in compat_threads.cNick Mathewson
2015-01-22Move a redundant _GNU_SOURCE to where it is not redundantNick Mathewson
2015-01-21handle EINTR in compat_*threads.cNick Mathewson
2015-01-14Fix check-spacesNick Mathewson
2015-01-14"Recursive" locks, not "reentrant" locks. Duh.Nick Mathewson
2015-01-14Fix linux compilation (pipe2 needs _GNU_SOURCE)Nick Mathewson
2015-01-14Test a little more of compat_threads.cNick Mathewson
2015-01-14Rename mutex_for_cond -> mutex_nonreentrantNick Mathewson
We'll want to use these for other stuff too.
2015-01-14Documentation for new workqueue and condition and locking stuffNick Mathewson
2015-01-14Isolate the "socketpair or a pipe" logic for alerting main threadNick Mathewson
This way we can use the linux eventfd extension where available. Using EVFILT_USER on the BSDs will be a teeny bit trickier, and will require libevent hacking.
2015-01-14Add tor_cond_init/uninitNick Mathewson
2015-01-14Split threading-related code out of compat.cNick Mathewson
Also, re-enable the #if'd out condition-variable code. Work queues are going to make us hack on all of this stuff a bit more closely, so it might not be a terrible idea to make it easier to hack.