Add scheduling notifications to scheduler_affine.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32463 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include <int.h>
|
#include <int.h>
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <kscheduler.h>
|
#include <kscheduler.h>
|
||||||
|
#include <listeners.h>
|
||||||
#include <scheduler_defs.h>
|
#include <scheduler_defs.h>
|
||||||
#include <smp.h>
|
#include <smp.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
@@ -199,6 +200,10 @@ affine_enqueue_in_run_queue(struct thread *thread)
|
|||||||
smp_send_ici(idleCPU, SMP_MSG_RESCHEDULE_IF_IDLE, 0, 0,
|
smp_send_ici(idleCPU, SMP_MSG_RESCHEDULE_IF_IDLE, 0, 0,
|
||||||
0, NULL, SMP_MSG_FLAG_ASYNC);
|
0, NULL, SMP_MSG_FLAG_ASYNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// notify listeners
|
||||||
|
NotifySchedulerListeners(&SchedulerListener::ThreadEnqueuedInRunQueue,
|
||||||
|
thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct thread *
|
static inline struct thread *
|
||||||
@@ -295,6 +300,10 @@ affine_set_thread_priority(struct thread *thread, int32 priority)
|
|||||||
|
|
||||||
T(RemoveThread(thread));
|
T(RemoveThread(thread));
|
||||||
|
|
||||||
|
// notify listeners
|
||||||
|
NotifySchedulerListeners(&SchedulerListener::ThreadRemovedFromRunQueue,
|
||||||
|
thread);
|
||||||
|
|
||||||
// search run queues for the thread
|
// search run queues for the thread
|
||||||
// TODO: keep track of the queue a thread is in (perhaps in a
|
// TODO: keep track of the queue a thread is in (perhaps in a
|
||||||
// data pointer on the thread struct) so we only have to walk
|
// data pointer on the thread struct) so we only have to walk
|
||||||
@@ -436,6 +445,10 @@ affine_reschedule(void)
|
|||||||
|
|
||||||
T(ScheduleThread(nextThread, oldThread));
|
T(ScheduleThread(nextThread, oldThread));
|
||||||
|
|
||||||
|
// notify listeners
|
||||||
|
NotifySchedulerListeners(&SchedulerListener::ThreadScheduled,
|
||||||
|
oldThread, nextThread);
|
||||||
|
|
||||||
nextThread->state = B_THREAD_RUNNING;
|
nextThread->state = B_THREAD_RUNNING;
|
||||||
nextThread->next_state = B_THREAD_READY;
|
nextThread->next_state = B_THREAD_READY;
|
||||||
oldThread->was_yielded = false;
|
oldThread->was_yielded = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user