diff --git a/src/system/kernel/scheduler/scheduler_affine.cpp b/src/system/kernel/scheduler/scheduler_affine.cpp index 5145dad551..5f19de7616 100644 --- a/src/system/kernel/scheduler/scheduler_affine.cpp +++ b/src/system/kernel/scheduler/scheduler_affine.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -199,6 +200,10 @@ affine_enqueue_in_run_queue(struct thread *thread) smp_send_ici(idleCPU, SMP_MSG_RESCHEDULE_IF_IDLE, 0, 0, 0, NULL, SMP_MSG_FLAG_ASYNC); } + + // notify listeners + NotifySchedulerListeners(&SchedulerListener::ThreadEnqueuedInRunQueue, + thread); } static inline struct thread * @@ -295,6 +300,10 @@ affine_set_thread_priority(struct thread *thread, int32 priority) T(RemoveThread(thread)); + // notify listeners + NotifySchedulerListeners(&SchedulerListener::ThreadRemovedFromRunQueue, + thread); + // search run queues for the thread // 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 @@ -436,6 +445,10 @@ affine_reschedule(void) T(ScheduleThread(nextThread, oldThread)); + // notify listeners + NotifySchedulerListeners(&SchedulerListener::ThreadScheduled, + oldThread, nextThread); + nextThread->state = B_THREAD_RUNNING; nextThread->next_state = B_THREAD_READY; oldThread->was_yielded = false;