Revert "scheduler: SCHEDULER_EXIT_FUNCTION() is not needed"

This reverts commit 667617ad043a4587d8d366d5192d9ad291cfa37a.

Scheduler profiler uses CPU local data to store function information, hence
arch_thread_context_switch() usually is not a problem. However, when
we switch to a new thread we end up scheduler_new_thread_entry() instead
of scheduler_reschedule() what may corrupt data collected by the profiler.
This commit is contained in:
Pawel Dziepak 2014-01-17 01:44:46 +01:00
parent 3dce49af0e
commit 0269dd284e
2 changed files with 6 additions and 0 deletions

View File

@ -495,6 +495,8 @@ reschedule(int32 nextState)
modeLocker.Unlock();
SCHEDULER_EXIT_FUNCTION();
if (nextThread != oldThread)
switch_thread(oldThread, nextThread);
}

View File

@ -16,6 +16,9 @@
#define SCHEDULER_ENTER_FUNCTION() \
Scheduler::Profiling::Function schedulerProfiler(__PRETTY_FUNCTION__)
#define SCHEDULER_EXIT_FUNCTION() \
schedulerProfiler.Exit()
namespace Scheduler {
@ -124,6 +127,7 @@ Function::Exit()
#else // SCHEDULER_PROFILING
#define SCHEDULER_ENTER_FUNCTION() (void)0
#define SCHEDULER_EXIT_FUNCTION() (void)0
#endif // !SCHEDULER_PROFILING