From de59c065c57cb8526662ee6da28a57ad16fdde66 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 27 Sep 2017 15:08:33 +0200 Subject: posix: Implement self-contained POSIX mutex POSIX mutexes are now available in all configurations and no longer depend on --enable-posix. Update #2514. Update #3112. --- cpukit/posix/src/mutexsetprioceiling.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'cpukit/posix/src/mutexsetprioceiling.c') diff --git a/cpukit/posix/src/mutexsetprioceiling.c b/cpukit/posix/src/mutexsetprioceiling.c index 9288ffd828..87d9ba46f3 100644 --- a/cpukit/posix/src/mutexsetprioceiling.c +++ b/cpukit/posix/src/mutexsetprioceiling.c @@ -49,17 +49,19 @@ int pthread_mutex_setprioceiling( return EINVAL; } - the_mutex = _POSIX_Mutex_Get_no_protection( mutex ); - _Assert( the_mutex != NULL ); + the_mutex = _POSIX_Mutex_Get( mutex ); - if ( the_mutex->protocol == POSIX_MUTEX_PRIORITY_CEILING ) { + if ( + _POSIX_Mutex_Get_protocol( the_mutex->flags ) + == POSIX_MUTEX_PRIORITY_CEILING + ) { const Scheduler_Control *scheduler; bool valid; Priority_Control new_priority; Priority_Control old_priority; - scheduler = _CORE_ceiling_mutex_Get_scheduler( &the_mutex->Mutex ); - old_priority = _CORE_ceiling_mutex_Get_priority( &the_mutex->Mutex ); + scheduler = _POSIX_Mutex_Get_scheduler( the_mutex ); + old_priority = _POSIX_Mutex_Get_priority( the_mutex ); *old_ceiling = _POSIX_Priority_From_core( scheduler, old_priority ); new_priority = _POSIX_Priority_To_core( scheduler, prioceiling, &valid ); @@ -69,8 +71,8 @@ int pthread_mutex_setprioceiling( _Thread_queue_Context_initialize( &queue_context ); _Thread_queue_Context_clear_priority_updates( &queue_context ); - _CORE_ceiling_mutex_Set_priority( - &the_mutex->Mutex, + _POSIX_Mutex_Set_priority( + the_mutex, new_priority, &queue_context ); -- cgit v1.2.3