Skip to content

Commit

Permalink
Fix nasa#883, remove unreachable test
Browse files Browse the repository at this point in the history
The only way for this test happen would be if somehow the normal
unlock process was bypassed.
  • Loading branch information
jphickey committed Mar 12, 2021
1 parent 3b53af0 commit f81f974
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/os/shared/src/osapi-mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ int32 OS_MutSemTake(osal_id_t sem_id)
OS_mutex_internal_record_t *mutex;
OS_object_token_t token;
int32 return_code;
osal_id_t self_task;

/* Check Parameters */
return_code = OS_ObjectIdGetById(OS_LOCK_MODE_NONE, LOCAL_OBJID_TYPE, sem_id, &token);
Expand All @@ -209,16 +208,8 @@ int32 OS_MutSemTake(osal_id_t sem_id)
return_code = OS_MutSemTake_Impl(&token);
if (return_code == OS_SUCCESS)
{
self_task = OS_TaskGetId();

if (OS_ObjectIdDefined(mutex->last_owner))
{
OS_DEBUG("WARNING: Task %lu taking mutex %lu while owned by task %lu\n",
OS_ObjectIdToInteger(self_task), OS_ObjectIdToInteger(sem_id),
OS_ObjectIdToInteger(mutex->last_owner));
}

mutex->last_owner = self_task;
/* Always set the owner if OS_MutSemTake_Impl() returned success */
mutex->last_owner = OS_TaskGetId();
}
}

Expand Down

0 comments on commit f81f974

Please sign in to comment.