diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-14 09:11:07 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-18 07:30:31 +0100 |
commit | d78d5294cd076b48160e12c2f52a940d783b4dac (patch) | |
tree | 15bdd7b4b424b6c4ab49435e71ac6c795bb5a58d /cpukit/posix/src | |
parent | score: Remove obsolete defines (diff) | |
download | rtems-d78d5294cd076b48160e12c2f52a940d783b4dac.tar.bz2 |
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.
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r-- | cpukit/posix/src/nanosleep.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/sched_yield.c | 2 |
2 files changed, 2 insertions, 2 deletions
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; } |