diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-23 11:57:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-02 10:05:42 +0100 |
commit | 07a32d193257f150e5237970a7fa864ab71817b3 (patch) | |
tree | 86cfe743e9d8d811e38881db40c9bb1f6d19b52b /cpukit/score/include/rtems | |
parent | score: Add _Thread_Scheduler_remove_wait_node() (diff) | |
download | rtems-07a32d193257f150e5237970a7fa864ab71817b3.tar.bz2 |
score: Add thread scheduler lock
Update #2556.
Diffstat (limited to 'cpukit/score/include/rtems')
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 5 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index d839b1f9ec..eb272e6c01 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -246,6 +246,11 @@ typedef enum { typedef struct { #if defined(RTEMS_SMP) /** + * @brief Lock to protect the scheduler node change requests. + */ + ISR_lock_Control Lock; + + /** * @brief The current scheduler state of this thread. */ Thread_Scheduler_state state; diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index f259e74d49..8254b97183 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -1035,6 +1035,22 @@ RTEMS_INLINE_ROUTINE Scheduler_Node *_Thread_Scheduler_get_node_by_index( } #if defined(RTEMS_SMP) +RTEMS_INLINE_ROUTINE void _Thread_Scheduler_acquire_critical( + Thread_Control *the_thread, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_Acquire( &the_thread->Scheduler.Lock, lock_context ); +} + +RTEMS_INLINE_ROUTINE void _Thread_Scheduler_release_critical( + Thread_Control *the_thread, + ISR_lock_Context *lock_context +) +{ + _ISR_lock_Release( &the_thread->Scheduler.Lock, lock_context ); +} + RTEMS_INLINE_ROUTINE void _Thread_Scheduler_add_wait_node( Thread_Control *the_thread, Scheduler_Node *scheduler_node |