Merge pull request #8044 from diizzyy/libs-jsoncpp
[feed/packages.git] / libs / libupnp / patches / 100-fix-pthread-detach.patch
1 From 386b7ed79146ecf7a3bba49f48cb8f41a9b49170 Mon Sep 17 00:00:00 2001
2 From: Jean-Francois Dockes <jf@dockes.org>
3 Date: Sun, 27 Jan 2019 10:44:17 +0100
4 Subject: [PATCH] Do not try to detach detached thread, the result is
5 undefined. Fixes issue #102
6
7 ---
8 upnp/src/threadutil/ThreadPool.c | 5 -----
9 1 file changed, 5 deletions(-)
10
11 --- a/upnp/src/threadutil/ThreadPool.c
12 +++ b/upnp/src/threadutil/ThreadPool.c
13 @@ -651,11 +651,6 @@ static int CreateWorker(
14 rc = ithread_create(&temp, &attr, WorkerThread, tp);
15 ithread_attr_destroy(&attr);
16 if (rc == 0) {
17 - rc = ithread_detach(temp);
18 - /* ithread_detach will return EINVAL if thread has been
19 - successfully detached by ithread_create */
20 - if (rc == EINVAL)
21 - rc = 0;
22 tp->pendingWorkerThreadStart = 1;
23 /* wait until the new worker thread starts */
24 while (tp->pendingWorkerThreadStart) {