summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/mutexsetprioceiling.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-27 15:08:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-05 14:29:02 +0200
commitde59c065c57cb8526662ee6da28a57ad16fdde66 (patch)
tree21f4a2adbd58f65f722051bca435572fbf5dcf05 /cpukit/posix/src/mutexsetprioceiling.c
parentposix: Implement self-contained POSIX condvar (diff)
downloadrtems-de59c065c57cb8526662ee6da28a57ad16fdde66.tar.bz2
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.
Diffstat (limited to 'cpukit/posix/src/mutexsetprioceiling.c')
-rw-r--r--cpukit/posix/src/mutexsetprioceiling.c16
1 files changed, 9 insertions, 7 deletions
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
);