aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_pthreads.c
AgeCommit message (Collapse)Author
2015-12-16Don't call pthread_condattr_setclock() unless it existsNick Mathewson
Fixes bug 17819; bugfix on 0.2.6.3-alpha (specifically, d684dbb0).
2015-08-18Use thread-local storage to block event_queue recursion.Nick Mathewson
2015-07-21Fix some potential memory leaks in the thread pool code.cypherpunks
2015-06-03Fix an incorrect comment on spawn_functeor
spawn_func calls pthread_create on unix, not fork Fix on existing code split out of compat.c into compat_pthreads.c in c2f0d52b7fb9
2015-03-13const-ify the new failure vars, and one old oneNick Mathewson
2015-03-12don't init threads as side effect of assertionSebastian Hahn
Fixes part of bug 15211.
2015-03-12Use PTHREAD_CREATE_DETACHED macro instead of 1: fix Solaris crashNick Mathewson
When calling pthread_attr_setdetachstate, we were using 1 as the argument. But the pthreads documentation says that you have to say PTHREAD_CREATE_DETACH, which on Solaris is apparently 0x40. Calling pthread_attr_setdetachstate with 1 crashes on Solaris with FLTBOUNDS. (Because we're so late in the release cycle, I made the code define PTHREAD_CREATE_DETACHED if it doesn't exist, so we aren't likely to break any other platforms.) This bug was introduced when we made threading mandatory in 0.2.6.1-alpha; previously, we had force-disabled threading on Solaris. See #9495 discussion.
2015-01-22Move a redundant _GNU_SOURCE to where it is not redundantNick Mathewson
2015-01-21Support monotonic time for pthread_cond_timedwaitDavid Goulet
This is to avoid that the pthread_cond_timedwait() is not affected by time adjustment which could make the waiting period very long or very short which is not what we want in any cases. Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-21Fix up some workqueue/threading issues spotted by dgoulet.Nick Mathewson
2015-01-21handle EINTR in compat_*threads.cNick Mathewson
2015-01-15Update workqueue implementation to use a single queue for the workNick Mathewson
Previously I used one queue per worker; now I use one queue for everyone. The "broadcast" code is gone, replaced with an idempotent 'update' operation.
2015-01-14Fix check-spacesNick Mathewson
2015-01-14"Recursive" locks, not "reentrant" locks. Duh.Nick Mathewson
2015-01-14Use correct (absolute) time for pthread_cond_timedwaitNick 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-14Specialize handling for mutexes allocated for condition variablesNick Mathewson
(These must not be reentrant mutexes with pthreads.)
2015-01-14Add tor_cond_init/uninitNick Mathewson
2015-01-14Add a timeout to tor_cond_wait; add tor_cond impl from libeventNick Mathewson
The windows code may need some tweaks for it to compile; I've not tested it yet.
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.