Skip to content

Commit

Permalink
WIP: fix race
Browse files Browse the repository at this point in the history
  • Loading branch information
ko1 committed Oct 2, 2023
1 parent 4d33018 commit 595a35d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion thread_pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,6 @@ static void
native_thread_cleanup(struct rb_native_thread *nt)
{
RB_ALTSTACK_FREE(nt->altstack);
ruby_xfree(nt);
}

static struct rb_native_thread *
Expand Down Expand Up @@ -2217,12 +2216,15 @@ rb_threadptr_sched_free(rb_thread_t *th)
#if USE_MN_THREADS
if (th->sched.malloc_stack) {
ruby_xfree(th->sched.context_stack);
ruby_xfree(th->nt);
}
else {
nt_free_stack(th->sched.context_stack);
// TODO: how to free nt?
}
#else
ruby_xfree(th->sched.context_stack);
ruby_xfree(th->nt);
#endif
}

Expand Down

0 comments on commit 595a35d

Please sign in to comment.