lib/upnp/WorkQueue: fix race condition
With "ok==false", newly created threads may quit instantly.
This commit is contained in:
parent
32a64481f2
commit
678524ad21
@ -97,6 +97,7 @@ public:
|
||||
assert(n_threads == 0);
|
||||
assert(threads == nullptr);
|
||||
|
||||
ok = true;
|
||||
n_threads = nworkers;
|
||||
threads = new pthread_t[n_threads];
|
||||
|
||||
@ -109,7 +110,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
ok = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user