Skip to content

Commit

Permalink
pthread: destroy cleanup handlers on cancel
Browse files Browse the repository at this point in the history
JIRA: RTOS-671
  • Loading branch information
badochov authored and agkaminski committed Nov 9, 2023
1 parent 42b71a4 commit 090a2fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pthread/pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ int pthread_cancel(pthread_t thread)
}
else {
if (ctx->cancelstate == PTHREAD_CANCEL_ENABLE) {
_pthread_do_cleanup(ctx);
ctx->retval = (void *)PTHREAD_CANCELED;
id = ctx->id;
mutexUnlock(pthread_common.pthread_list_lock);
Expand Down Expand Up @@ -589,7 +590,7 @@ int pthread_attr_setschedparam(pthread_attr_t *attr,
return EINVAL;

if (param->sched_priority > sched_get_priority_max(SCHED_RR) ||
param->sched_priority < sched_get_priority_min(SCHED_RR))
param->sched_priority < sched_get_priority_min(SCHED_RR))

Check failure on line 593 in pthread/pthread.c

View workflow job for this annotation

GitHub Actions / clang-format

[clang-format] pthread/pthread.c#L593

suggested fix
Raw output
pthread/pthread.c:593:-			param->sched_priority < sched_get_priority_min(SCHED_RR))
pthread/pthread.c:593:+		param->sched_priority < sched_get_priority_min(SCHED_RR))
return ENOTSUP;

attr->priority = param->sched_priority;
Expand Down Expand Up @@ -652,7 +653,7 @@ int pthread_attr_getscope(const pthread_attr_t *attr,
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
{
if ((detachstate != PTHREAD_CREATE_DETACHED) ||
(detachstate != PTHREAD_CREATE_JOINABLE)) {
(detachstate != PTHREAD_CREATE_JOINABLE)) {

Check failure on line 656 in pthread/pthread.c

View workflow job for this annotation

GitHub Actions / clang-format

[clang-format] pthread/pthread.c#L656

suggested fix
Raw output
pthread/pthread.c:656:-			(detachstate != PTHREAD_CREATE_JOINABLE)) {
pthread/pthread.c:656:+		(detachstate != PTHREAD_CREATE_JOINABLE)) {
return EINVAL;
}

Expand Down

0 comments on commit 090a2fd

Please sign in to comment.