From d78d5294cd076b48160e12c2f52a940d783b4dac Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 14 Nov 2016 09:11:07 +0100 Subject: score: Add and use _Thread_Dispatch_direct() This function is useful for operations which synchronously block, e.g. self restart, self deletion, yield, sleep. It helps to detect if these operations are called in the wrong context. Since the thread dispatch necessary indicator is not used, this is more robust in some SMP situations. Update #2751. --- cpukit/posix/src/nanosleep.c | 2 +- cpukit/posix/src/sched_yield.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cpukit/posix/src') diff --git a/cpukit/posix/src/nanosleep.c b/cpukit/posix/src/nanosleep.c index 38a6b8d6c8..0fec1e48e1 100644 --- a/cpukit/posix/src/nanosleep.c +++ b/cpukit/posix/src/nanosleep.c @@ -96,7 +96,7 @@ static inline int nanosleep_yield( struct timespec *rmtp ) executing = _Thread_Get_executing(); cpu_self = _Thread_Dispatch_disable(); _Thread_Yield( executing ); - _Thread_Dispatch_enable( cpu_self ); + _Thread_Dispatch_direct( cpu_self ); if ( rmtp ) { rmtp->tv_sec = 0; rmtp->tv_nsec = 0; diff --git a/cpukit/posix/src/sched_yield.c b/cpukit/posix/src/sched_yield.c index 7e056cef27..cbbcb34dd6 100644 --- a/cpukit/posix/src/sched_yield.c +++ b/cpukit/posix/src/sched_yield.c @@ -30,6 +30,6 @@ int sched_yield( void ) cpu_self = _Thread_Dispatch_disable(); _Thread_Yield( _Per_CPU_Get_executing( cpu_self ) ); - _Thread_Dispatch_enable( cpu_self ); + _Thread_Dispatch_direct( cpu_self ); return 0; } -- cgit v1.2.3