From 2d2352bab92c51c2fd857b9555242545bd08c95e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 5 Jun 2013 11:48:57 +0200 Subject: score: Add and use _Objects_Put() Add and use _Objects_Put_without_thread_dispatch(). These two functions pair with the _Objects_Get() function. This helps to introduce object specific SMP locks to avoid lock contention. --- cpukit/score/inline/rtems/score/object.inl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'cpukit/score/inline/rtems') diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl index 54365fa8eb..bab5f984e3 100644 --- a/cpukit/score/inline/rtems/score/object.inl +++ b/cpukit/score/inline/rtems/score/object.inl @@ -376,6 +376,35 @@ RTEMS_INLINE_ROUTINE bool _Objects_Is_unlimited( uint32_t maximum ) #endif +/** + * @brief Puts back an object obtained with _Objects_Get(). + * + * This function decrements the thread dispatch disable level. The + * _Thread_Dispatch() is called if the level reaches zero. + */ +RTEMS_INLINE_ROUTINE void _Objects_Put( + Objects_Control *the_object +) +{ + (void) the_object; + _Thread_Enable_dispatch(); +} + +/** + * @brief Puts back an object obtained with _Objects_Get(). + * + * This function decrements the thread dispatch disable level. The + * _Thread_Dispatch() is not called if the level reaches zero, thus a thread + * dispatch will not take place immediately on the current processor. + */ +RTEMS_INLINE_ROUTINE void _Objects_Put_without_thread_dispatch( + Objects_Control *the_object +) +{ + (void) the_object; + _Thread_Unnest_dispatch(); +} + /** * @brief Puts back an object obtained with _Objects_Get_isr_disable(). */ -- cgit v1.2.3