Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #883, remove unreachable test #899

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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