Commit 83387b8b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Initialize pthreads stuff before we use it.

Spotted by: OSX pthread implementation
parent 07d9e57d
...@@ -418,6 +418,8 @@ pool_mkpool(unsigned pool_no) ...@@ -418,6 +418,8 @@ pool_mkpool(unsigned pool_no)
VTAILQ_INIT(&pp->back_queue); VTAILQ_INIT(&pp->back_queue);
pp->sesspool = SES_NewPool(pp, pool_no); pp->sesspool = SES_NewPool(pp, pool_no);
AN(pp->sesspool); AN(pp->sesspool);
AZ(pthread_cond_init(&pp->herder_cond, NULL));
AZ(pthread_create(&pp->herder_thr, NULL, pool_herder, pp));
VTAILQ_FOREACH(ls, &heritage.socks, list) { VTAILQ_FOREACH(ls, &heritage.socks, list) {
if (ls->sock < 0) if (ls->sock < 0)
...@@ -430,9 +432,6 @@ pool_mkpool(unsigned pool_no) ...@@ -430,9 +432,6 @@ pool_mkpool(unsigned pool_no)
AZ(Pool_Task(pp, &ps->task, POOL_QUEUE_BACK)); AZ(Pool_Task(pp, &ps->task, POOL_QUEUE_BACK));
} }
AZ(pthread_cond_init(&pp->herder_cond, NULL));
AZ(pthread_create(&pp->herder_thr, NULL, pool_herder, pp));
return (pp); return (pp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment