diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2015-04-14 10:01:05 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2015-04-14 11:17:10 -0500 |
commit | fc0756e8d9caf1155e2df1ad4a1282619c6668f1 (patch) | |
tree | bf4aa3a51cac86cfb220a6d34ba7538d60fb780e /cpukit/score/include/rtems/score/apimutex.h | |
parent | or1ksim: Fix bug at UART driver. (diff) | |
download | rtems-fc0756e8d9caf1155e2df1ad4a1282619c6668f1.tar.bz2 |
Add test assertion for allocator mutex being unlocked
The Allocator Mutex should not be locked outside a tested
service call. In an SMP test or heavily multithreaded test,
this is possible since another thread could have the lock
for an extended period of time but this is not the norm
for the tests.
updates 2319.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/include/rtems/score/apimutex.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/apimutex.h b/cpukit/score/include/rtems/score/apimutex.h index 5f02e0a1cf..c960679d6b 100644 --- a/cpukit/score/include/rtems/score/apimutex.h +++ b/cpukit/score/include/rtems/score/apimutex.h @@ -85,6 +85,8 @@ void _API_Mutex_Lock( API_Mutex_Control *mutex ); */ void _API_Mutex_Unlock( API_Mutex_Control *mutex ); +bool _API_Mutex_Is_Locked( API_Mutex_Control *mutex ); + /** @} */ /** @@ -118,6 +120,11 @@ static inline void _RTEMS_Unlock_allocator( void ) _API_Mutex_Unlock( _RTEMS_Allocator_Mutex ); } +static inline bool _RTEMS_Check_if_allocator_is_locked( void ) +{ + return _API_Mutex_Is_Locked( _RTEMS_Allocator_Mutex ); +} + SCORE_EXTERN API_Mutex_Control *_Once_Mutex; static inline void _Once_Lock( void ) |