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

posix: pthread: do not assert in pthread_exit() on k_thread #62733

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Sep 16, 2023

If pthread_exit() is called from a k_thread, then we currently trigger an assertion. It is a reasonable expectation to have the calling thread exit or abort when calling pthread_exit(), so lets do just that, which mirrors the original behaviour.

Detected when the C++ threads PR was rebased, as POSIX is acting as a compatibility layer.

Fixes #62732

If `pthread_exit()` is called from a `k_thread`, then we would
previously trigger an assertion. The problem with that, is that
is POSIX is acting as a compatibility layer.

Given that it is a reasonable expectation to have the calling
thread exit or abort when calling `pthread_exit()`, lets do just
that.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
@cfriedt cfriedt added bug The issue is a bug, or the PR is fixing a bug area: POSIX POSIX API Library labels Sep 16, 2023
@cfriedt cfriedt self-assigned this Sep 16, 2023
@cfriedt cfriedt added the Regression Something, which was working, does not anymore label Sep 16, 2023
@cfriedt cfriedt merged commit 1731010 into zephyrproject-rtos:main Sep 16, 2023
22 checks passed
@cfriedt cfriedt added the backport v3.4-branch Backport to the v3.4-branch label Sep 16, 2023
@cfriedt cfriedt deleted the issues/62732/posix-pthread-exit-on-non-pthread-asserts branch September 16, 2023 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library backport v3.4-branch Backport to the v3.4-branch bug The issue is a bug, or the PR is fixing a bug Regression Something, which was working, does not anymore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

posix: pthread_exit() on non-pthread asserts
3 participants