Skip to content

Commit

Permalink
Merge pull request #29 from Goobley/LeakFix
Browse files Browse the repository at this point in the history
sched memory leak on unjoined pthreads.
  • Loading branch information
vurtun committed Apr 6, 2020
2 parents 1569895 + 99d7b1e commit 40f1722
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 40f1722

Please sign in to comment.