mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 17:20:48 +08:00
score: Delete CORE_mutex_Control::holder_id
We can use the holder pointer to get the identifier if necessary.
This commit is contained in:
@@ -24,8 +24,7 @@ rtems_monitor_sema_canonical(
|
||||
canonical_sema->priority_ceiling =
|
||||
rtems_sema->Core_control.mutex.Attributes.priority_ceiling;
|
||||
|
||||
canonical_sema->holder_id =
|
||||
rtems_sema->Core_control.mutex.holder_id;
|
||||
canonical_sema->holder_id = 0;
|
||||
|
||||
if (_Attributes_Is_counting_semaphore(canonical_sema->attribute)) {
|
||||
/* we have a counting semaphore */
|
||||
@@ -36,6 +35,12 @@ rtems_monitor_sema_canonical(
|
||||
rtems_sema->Core_control.semaphore.Attributes.maximum_count;
|
||||
}
|
||||
else {
|
||||
Thread_Control *holder = rtems_sema->Core_control.mutex.holder;
|
||||
|
||||
if (holder != NULL) {
|
||||
canonical_sema->holder_id = holder->Object.id;
|
||||
}
|
||||
|
||||
/* we have a binary semaphore (mutex) */
|
||||
canonical_sema->cur_count = rtems_sema->Core_control.mutex.lock;
|
||||
canonical_sema->max_count = 1; /* mutex is either 0 or 1 */
|
||||
|
||||
@@ -167,8 +167,6 @@ typedef struct {
|
||||
* has not unlocked it. If the thread is not locked, there is no holder.
|
||||
*/
|
||||
Thread_Control *holder;
|
||||
/** This element contains the object Id of the holding thread. */
|
||||
Objects_Id holder_id;
|
||||
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
|
||||
/** This field is used to manipulate the priority inheritance mutex queue*/
|
||||
CORE_mutex_order_list queue;
|
||||
|
||||
@@ -454,7 +454,6 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
|
||||
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
|
||||
the_mutex->lock = CORE_MUTEX_LOCKED;
|
||||
the_mutex->holder = executing;
|
||||
the_mutex->holder_id = executing->Object.id;
|
||||
the_mutex->nest_count = 1;
|
||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){
|
||||
|
||||
@@ -42,7 +42,6 @@ CORE_mutex_Status _CORE_mutex_Initialize(
|
||||
if ( initial_lock == CORE_MUTEX_LOCKED ) {
|
||||
the_mutex->nest_count = 1;
|
||||
the_mutex->holder = executing;
|
||||
the_mutex->holder_id = executing->Object.id;
|
||||
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
|
||||
_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) {
|
||||
|
||||
@@ -60,7 +59,6 @@ CORE_mutex_Status _CORE_mutex_Initialize(
|
||||
} else {
|
||||
the_mutex->nest_count = 0;
|
||||
the_mutex->holder = NULL;
|
||||
the_mutex->holder_id = 0;
|
||||
}
|
||||
|
||||
_Thread_queue_Initialize(
|
||||
|
||||
@@ -172,8 +172,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
_Thread_Change_priority( holder, holder->real_priority, true );
|
||||
}
|
||||
}
|
||||
the_mutex->holder = NULL;
|
||||
the_mutex->holder_id = 0;
|
||||
the_mutex->holder = NULL;
|
||||
|
||||
/*
|
||||
* Now we check if another thread was waiting for this mutex. If so,
|
||||
@@ -185,7 +184,6 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
|
||||
|
||||
the_mutex->holder = NULL;
|
||||
the_mutex->holder_id = the_thread->Object.id;
|
||||
the_mutex->nest_count = 1;
|
||||
|
||||
( *api_mutex_mp_support)( the_thread, id );
|
||||
@@ -195,7 +193,6 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
{
|
||||
|
||||
the_mutex->holder = the_thread;
|
||||
the_mutex->holder_id = the_thread->Object.id;
|
||||
the_mutex->nest_count = 1;
|
||||
|
||||
switch ( the_mutex->Attributes.discipline ) {
|
||||
|
||||
Reference in New Issue
Block a user