anevilyak+mmlr:
* scheduler_enqueue_in_runqueue() now allows the scheduler to return a hint as to whether a reschedule is desirable or not. This is used in a few other places in order to relegate scheduling decisions entirely to the scheduler rather than the priority hacks previously used. There are probably other places in the kernel that could now make use of that information to more intelligently call reschedule() though. * Switch over the default scheduler to scheduler_affine(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32554 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2275,14 +2275,10 @@ thread_block_timeout(timer* timer)
|
||||
// easy.
|
||||
|
||||
struct thread* thread = (struct thread*)timer->user_data;
|
||||
if (thread_unblock_locked(thread, B_TIMED_OUT)) {
|
||||
// We actually woke up the thread. If it has a higher priority than the
|
||||
// currently running thread, we invoke the scheduler.
|
||||
// TODO: Is this really such a good idea or should we do that only when
|
||||
// the woken up thread has realtime priority?
|
||||
if (thread->priority > thread_get_current_thread()->priority)
|
||||
return B_INVOKE_SCHEDULER;
|
||||
}
|
||||
// the scheduler will tell us whether to reschedule or not via
|
||||
// thread_unblock_locked's return
|
||||
if (thread_unblock_locked(thread, B_TIMED_OUT))
|
||||
return B_INVOKE_SCHEDULER;
|
||||
|
||||
return B_HANDLED_INTERRUPT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user