Skip to content

Commit

Permalink
kernel: use interrupts until preemption disabling is implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Oct 24, 2024
1 parent 020bd5b commit b120dcd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/kernel/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,12 +623,10 @@ void kthread_resume(kthread_t *th)
void kthread_detach(kthread_t *th)
{
if (th == NULL) th = th_cur;
// disable_interrupts();
kernel_preempt_disable();
disable_interrupts();
assertf((th->flags & TH_FLAG_WAITFORJOIN) == 0, "cannot detach thread %s[%p] which is already exited", th->name, th);
th->flags |= TH_FLAG_DETACHED;
kernel_preempt_enable();
// enable_interrupts();
enable_interrupts();
}

int kthread_join(kthread_t *th)
Expand Down

0 comments on commit b120dcd

Please sign in to comment.