lib/upnp/WorkQueue: fix race condition

With "ok==false", newly created threads may quit instantly.
This commit is contained in:
Max Kellermann 2017-01-23 19:25:30 +01:00
parent 32a64481f2
commit 678524ad21

View File

@ -97,6 +97,7 @@ public:
assert(n_threads == 0); assert(n_threads == 0);
assert(threads == nullptr); assert(threads == nullptr);
ok = true;
n_threads = nworkers; n_threads = nworkers;
threads = new pthread_t[n_threads]; threads = new pthread_t[n_threads];
@ -109,7 +110,6 @@ public:
} }
} }
ok = true;
return true; return true;
} }