unix: initialize thread pool mutex and condvar

It accidentally worked before this commit on Linux but not on OS X.

Fixes #637.
This commit is contained in:
Ben Noordhuis 2012-11-29 15:34:33 +01:00
parent 3a30258616
commit 2be240d3cd

View File

@ -76,6 +76,12 @@ static void post(ngx_queue_t* q) {
static void init_once(void) {
unsigned int i;
if (uv_cond_init(&cond))
abort();
if (uv_mutex_init(&mutex))
abort();
ngx_queue_init(&wq);
for (i = 0; i < ARRAY_SIZE(threads); i++)
@ -100,6 +106,8 @@ static void cleanup(void) {
if (uv_thread_join(threads + i))
abort();
uv_mutex_destroy(&mutex);
uv_cond_destroy(&cond);
initialized = 0;
}
#endif