Skip to content

Commit

Permalink
Do not try to detach detached thread, the result is undefined. Fixes …
Browse files Browse the repository at this point in the history
…issue pupnp#102

(cherry picked from commit 386b7ed)
  • Loading branch information
medoc92 authored and mrjimenez committed Jan 27, 2019
1 parent 0b07957 commit 04b454f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions upnp/src/threadutil/ThreadPool.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,6 @@ static int CreateWorker(
rc = ithread_create(&temp, &attr, WorkerThread, tp);
ithread_attr_destroy(&attr);
if (rc == 0) {
rc = ithread_detach(temp);
/* ithread_detach will return EINVAL if thread has been
successfully detached by ithread_create */
if (rc == EINVAL)
rc = 0;
tp->pendingWorkerThreadStart = 1;
/* wait until the new worker thread starts */
while (tp->pendingWorkerThreadStart) {
Expand Down

0 comments on commit 04b454f

Please sign in to comment.