diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-03-23 15:34:26 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-15 09:53:17 +0100 |
commit | ee57a7f1a16dbbedbf07bc629de19667dae131eb (patch) | |
tree | 375529eee1dbda0034b89fb7cd06051a764f182f /cpukit/include | |
parent | score: Always check if a prio ceiling is defined (diff) | |
download | rtems-ee57a7f1a16dbbedbf07bc629de19667dae131eb.tar.bz2 |
score: Fix _CORE_ceiling_mutex_Set_priority()
We have to use a second thread queue context to acquire and release the
thread wait lock.
Close #4356.
Diffstat (limited to 'cpukit/include')
-rw-r--r-- | cpukit/include/rtems/score/coremuteximpl.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cpukit/include/rtems/score/coremuteximpl.h b/cpukit/include/rtems/score/coremuteximpl.h index 1f9682a6b5..5114f33e0d 100644 --- a/cpukit/include/rtems/score/coremuteximpl.h +++ b/cpukit/include/rtems/score/coremuteximpl.h @@ -357,12 +357,10 @@ _CORE_ceiling_mutex_Get_scheduler( * * @param[out] the_mutex The ceiling mutex to set the priority of. * @param priority_ceiling The new priority ceiling of the mutex. - * @param queue_context The thread queue context. */ RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority( CORE_ceiling_mutex_Control *the_mutex, - Priority_Control priority_ceiling, - Thread_queue_Context *queue_context + Priority_Control priority_ceiling ) { Thread_Control *owner; @@ -370,15 +368,19 @@ RTEMS_INLINE_ROUTINE void _CORE_ceiling_mutex_Set_priority( owner = _CORE_mutex_Get_owner( &the_mutex->Recursive.Mutex ); if ( owner != NULL ) { - _Thread_Wait_acquire( owner, queue_context ); + Thread_queue_Context queue_context; + + _Thread_queue_Context_initialize( &queue_context ); + _Thread_queue_Context_clear_priority_updates( &queue_context ); + _Thread_Wait_acquire_critical( owner, &queue_context ); _Thread_Priority_change( owner, &the_mutex->Priority_ceiling, priority_ceiling, PRIORITY_GROUP_LAST, - queue_context + &queue_context ); - _Thread_Wait_release( owner, queue_context ); + _Thread_Wait_release_critical( owner, &queue_context ); } else { the_mutex->Priority_ceiling.priority = priority_ceiling; } |