summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-01-23 19:25:30 +0100
committerMax Kellermann <max@musicpd.org>2017-01-23 19:25:30 +0100
commit678524ad2109853be9ecc682f2ad7017794c6222 (patch)
treef1b534def770e38e5bbd6b2b4683bf6b51de1031 /src
parent32a64481f22cb69c89ec0a34d5d556225ea61f4f (diff)
lib/upnp/WorkQueue: fix race condition
With "ok==false", newly created threads may quit instantly.
Diffstat (limited to 'src')
-rw-r--r--src/lib/upnp/WorkQueue.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/upnp/WorkQueue.hxx b/src/lib/upnp/WorkQueue.hxx
index 1144634f0..b503e9956 100644
--- a/src/lib/upnp/WorkQueue.hxx
+++ b/src/lib/upnp/WorkQueue.hxx
@@ -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;
}