Skip to content

Commit

Permalink
Merge pull request #899 from jphickey/fix-883-mutex-extra-check
Browse files Browse the repository at this point in the history
Fix #883, remove unreachable test
  • Loading branch information
astrogeco committed Mar 22, 2021
2 parents 6f02345 + f81f974 commit 0876712
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 0876712

Please sign in to comment.