Commit Graph

10 Commits

Author SHA1 Message Date
Ben Noordhuis
99a8d4a8c2 unix: remove unnecessary static var init
wq doesn't have to be initialized, init_once() takes care of that.

Remove the initialization so it goes into .bss instead of .data.
2012-11-29 16:54:09 +01:00
Ben Noordhuis
2be240d3cd unix: initialize thread pool mutex and condvar
It accidentally worked before this commit on Linux but not on OS X.

Fixes #637.
2012-11-29 15:34:35 +01:00
Ben Noordhuis
99d3102b90 unix: drop pthread dependency in threadpool.c
Replace the pthread code with their libuv counterparts. One step closer to a
shared thread pool implementation.
2012-11-26 02:08:54 +01:00
Shigeki Ohtsu
0cca5391ba unix, windows: disallow NULL worker in thread pool
See #629.
2012-11-24 01:09:49 +01:00
Ben Noordhuis
dcd3b55c19 unix: fix thread pool race condition
Send the wakeup signal to the main thread *before* releasing the lock. Doing it
the other way around introduces a race condition where the watcher may already
have been pulled off the work queue.
2012-11-22 15:01:17 +01:00
Ben Noordhuis
4affbe70b6 unix: remove unnecessary pthread_join ESRCH check
ESRCH means the thread never got started but we guard against that now.
2012-10-10 01:11:09 +02:00
Ben Noordhuis
40134c3537 unix: don't reap threads if none were started
Fixes a segmentation fault on 32 bits linux with glibc 2.15.

Thanks to Johan Bergström (@jbergstroem) for reporting the issue and testing
out the patch.
2012-10-08 00:37:03 +02:00
Ben Noordhuis
b9ed1a6dbf unix: don't abort() on EINVAL in threadpool.c
The FreeBSD implementation of pthread_join() returns EINVAL when a thread has
already quit, not ESRCH.
2012-10-06 22:58:28 +02:00
Artur Adib
fed718c6cb unix: move queue stuff from fs.c to threadpool.c 2012-10-03 23:56:01 +02:00
Ben Noordhuis
f35a4b628a unix: add custom thread pool 2012-10-01 22:53:59 +02:00