diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-03-20 13:41:27 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-03-24 14:35:05 +0100 |
commit | 4054c9164601830c7ead74be612d33c4717d8ea6 (patch) | |
tree | 10b417daff4d9013a3fda4ee6f42895129259984 /cpukit/score/src/threadchangepriority.c | |
parent | 3134eb826769099c9dfa662354ab4570ddcbc0d6 (diff) |
score: Add scheduler acquire/release
This is currently a global lock for all scheduler instances. It should
get replaced with one lock per scheduler instance in the future.
Update #2273.
Diffstat (limited to 'cpukit/score/src/threadchangepriority.c')
-rw-r--r-- | cpukit/score/src/threadchangepriority.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cpukit/score/src/threadchangepriority.c b/cpukit/score/src/threadchangepriority.c index 2baa9d2774..a011a8f5e5 100644 --- a/cpukit/score/src/threadchangepriority.c +++ b/cpukit/score/src/threadchangepriority.c @@ -39,8 +39,7 @@ void _Thread_Change_priority( * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) { - uint32_t my_generation; - ISR_Level level; + uint32_t my_generation; my_generation = the_thread->Priority.generation + 1; the_thread->current_priority = new_priority; @@ -54,7 +53,7 @@ void _Thread_Change_priority( _Thread_Lock_release( lock, &lock_context ); - _ISR_Disable( level ); + _Scheduler_Acquire( the_thread, &lock_context ); if ( the_thread->Priority.generation == my_generation ) { if ( _States_Is_ready( the_thread->current_state ) ) { @@ -68,7 +67,7 @@ void _Thread_Change_priority( } } - _ISR_Enable( level ); + _Scheduler_Release( the_thread, &lock_context ); } else { _Thread_Lock_release( lock, &lock_context ); } |