Skip to content

Commit

Permalink
pthread memory leak fix for unjoined Zombie threads if scheduler is r…
Browse files Browse the repository at this point in the history
…epeatedly shutdown and restarted (threads aren't joined)
  • Loading branch information
Goobley committed Apr 6, 2020
1 parent 1569895 commit 99d7b1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ sched_thread_create(sched_thread *returnid, void*(*StartFunc)(void*), void *arg)
SCHED_INTERN sched_int
sched_thread_term(sched_thread threadid)
{
return (pthread_cancel(threadid) == 0);
pthread_cancel(threadid);
return (pthread_join(threadid, NULL) == 0);
}

SCHED_INTERN sched_uint
Expand Down

0 comments on commit 99d7b1e

Please sign in to comment.