diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-15 16:31:33 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-22 14:00:28 +0200 |
commit | 1a4eac500c9a2942f4aff7e27ccdfae3b99c4cb9 (patch) | |
tree | f43e5044a2b719a8cfc04cf58a5a31d620bd9eca /cpukit/posix/src/mutexinit.c | |
parent | posix: Make POSIX API aware of scheduler instances (diff) | |
download | rtems-1a4eac500c9a2942f4aff7e27ccdfae3b99c4cb9.tar.bz2 |
posix: Generalize _POSIX_Priority_To_core()
Move POSIX API priority validation into _POSIX_Priority_To_core().
Diffstat (limited to 'cpukit/posix/src/mutexinit.c')
-rw-r--r-- | cpukit/posix/src/mutexinit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/posix/src/mutexinit.c b/cpukit/posix/src/mutexinit.c index 04c36e11bb..2cda90ea05 100644 --- a/cpukit/posix/src/mutexinit.c +++ b/cpukit/posix/src/mutexinit.c @@ -107,7 +107,8 @@ int pthread_mutex_init( #endif if ( protocol == POSIX_MUTEX_PRIORITY_CEILING ) { - int prio_ceiling; + int prio_ceiling; + bool valid; scheduler = _Scheduler_Get_own( _Thread_Get_executing() ); prio_ceiling = the_attr->prio_ceiling; @@ -116,11 +117,10 @@ int pthread_mutex_init( prio_ceiling = _POSIX_Priority_Get_maximum( scheduler ); } - if ( !_POSIX_Priority_Is_valid( scheduler, prio_ceiling ) ) { + priority = _POSIX_Priority_To_core( scheduler, prio_ceiling, &valid ); + if ( !valid ) { return EINVAL; } - - priority = _POSIX_Priority_To_core( scheduler, prio_ceiling ); } the_mutex = _POSIX_Mutex_Allocate(); |