sched: enforce ref-counting on current task/thread pointers
This commit is contained in:
+2
-1
@@ -44,7 +44,7 @@ unsigned long schedule_timeout(unsigned long ticks)
|
||||
{
|
||||
struct timer timer;
|
||||
|
||||
struct thread *self = current_thread();
|
||||
struct thread *self = get_current_thread();
|
||||
|
||||
timer.t_entry = QUEUE_ENTRY_INIT;
|
||||
timer.t_expiry = clock_ticks + ticks;
|
||||
@@ -58,6 +58,7 @@ unsigned long schedule_timeout(unsigned long ticks)
|
||||
schedule(SCHED_NORMAL);
|
||||
|
||||
remove_timer(&timer);
|
||||
put_current_thread(self);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user