Changeset 12f9c5b7 in rtems for cpukit/posix/src/mutexinit.c
- Timestamp:
- Apr 27, 2017, 11:52:01 PM (4 years ago)
- Branches:
- 5, master
- Children:
- 20775247
- Parents:
- c16d45a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/posix/src/mutexinit.c
rc16d45a5 r12f9c5b7 116 116 the_mutex->is_recursive = ( the_attr->type == PTHREAD_MUTEX_RECURSIVE ); 117 117 118 switch ( protocol ) { 119 case POSIX_MUTEX_PRIORITY_CEILING: { 120 int prio_ceiling; 121 bool valid; 122 Priority_Control priority; 118 if ( protocol == POSIX_MUTEX_PRIORITY_CEILING ) { 119 int prio_ceiling; 120 bool valid; 121 Priority_Control priority; 123 122 124 125 123 scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() ); 124 prio_ceiling = the_attr->prio_ceiling; 126 125 127 128 129 126 if ( prio_ceiling == INT_MAX ) { 127 prio_ceiling = _POSIX_Priority_Get_maximum( scheduler ); 128 } 130 129 131 priority = _POSIX_Priority_To_core( scheduler, prio_ceiling, &valid ); 132 if ( !valid ) { 133 _POSIX_Mutex_Free(the_mutex); 134 _Objects_Allocator_unlock(); 135 return EINVAL; 136 } 137 _CORE_ceiling_mutex_Initialize( &the_mutex->Mutex, scheduler, priority ); 138 break; 130 priority = _POSIX_Priority_To_core( scheduler, prio_ceiling, &valid ); 131 if ( !valid ) { 132 _POSIX_Mutex_Free(the_mutex); 133 _Objects_Allocator_unlock(); 134 return EINVAL; 139 135 } 140 default:141 _Assert(142 the_mutex->protocol == POSIX_MUTEX_NO_PROTOCOL143 || the_mutex->protocol == POSIX_MUTEX_PRIORITY_INHERIT144 ); 145 _CORE_recursive_mutex_Initialize( &the_mutex->Mutex.Recursive);146 break;136 _CORE_ceiling_mutex_Initialize( &the_mutex->Mutex, scheduler, priority ); 137 } else { 138 _Assert( 139 the_mutex->protocol == POSIX_MUTEX_NO_PROTOCOL 140 || the_mutex->protocol == POSIX_MUTEX_PRIORITY_INHERIT 141 ); 142 _CORE_recursive_mutex_Initialize( &the_mutex->Mutex.Recursive ); 147 143 } 148 144
Note: See TracChangeset
for help on using the changeset viewer.