summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/sched_yield.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/sched_yield.c')
-rw-r--r--cpukit/posix/src/sched_yield.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/posix/src/sched_yield.c b/cpukit/posix/src/sched_yield.c
index 906d102a37..5293b199dc 100644
--- a/cpukit/posix/src/sched_yield.c
+++ b/cpukit/posix/src/sched_yield.c
@@ -26,8 +26,11 @@
int sched_yield( void )
{
+ Thread_Control *executing;
+
_Thread_Disable_dispatch();
- _Scheduler_Yield( _Thread_Executing );
+ executing = _Thread_Executing;
+ _Scheduler_Yield( _Scheduler_Get( executing ), executing );
_Thread_Enable_dispatch();
return 0;
}