Skip to content

posix: implement pthread_testcancel() #59946

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

Closed
Tracked by #51211
ycsin opened this issue Jul 3, 2023 · 1 comment · Fixed by #67020
Closed
Tracked by #51211

posix: implement pthread_testcancel() #59946

ycsin opened this issue Jul 3, 2023 · 1 comment · Fixed by #67020
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features

Comments

@ycsin
Copy link
Member

ycsin commented Jul 3, 2023

There are currently 20 missing POSIX functions with trivial implementations, pthread_testcancel() is one of them.

pthread_setcancelstate, pthread_setcanceltype, pthread_testcancel - set cancelability state

The pthread_setcancelstate() function shall atomically both set the calling thread's cancelability state to the indicated state and return the previous cancelability state at the location referenced by oldstate. Legal values for state are PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DISABLE.

The pthread_setcanceltype() function shall atomically both set the calling thread's cancelability type to the indicated type and return the previous cancelability type at the location referenced by oldtype. Legal values for type are PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.

The cancelability state and type of any newly created threads, including the thread in which main() was first invoked, shall be PTHREAD_CANCEL_ENABLE and PTHREAD_CANCEL_DEFERRED respectively.

The pthread_testcancel() function shall create a cancellation point in the calling thread. The pthread_testcancel() function shall have no effect if cancelability is disabled.

See https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_testcancel.html

See RFC #51211 for more info.

@ycsin ycsin added Feature Request A request for a new feature Good first issue Good for a first time contributor to take area: POSIX POSIX API Library labels Jul 3, 2023
@ycsin ycsin added this to the v3.5.0 milestone Jul 3, 2023
@ycsin ycsin moved this from To Do to LTS3 Goals in Release Plan Jul 3, 2023
@cfriedt cfriedt assigned cfriedt and unassigned cfriedt Jul 4, 2023
@cfriedt cfriedt removed the Good first issue Good for a first time contributor to take label Jul 20, 2023
@nashif nashif added Enhancement Changes/Updates/Additions to existing features and removed Feature Request A request for a new feature labels Jul 21, 2023
@cfriedt cfriedt removed the status in Release Plan Sep 12, 2023
@nashif nashif removed this from Release Plan Sep 13, 2023
@cfriedt cfriedt removed this from the v3.5.0 milestone Oct 13, 2023
@cfriedt
Copy link
Member

cfriedt commented Jan 4, 2024

Cannot assign to @moonlight83340, but they would like to implement this one.

Thanks for helping out 🙏

moonlight83340 added a commit to moonlight83340/zephyr that referenced this issue Feb 1, 2024
Implement posix pthread_testcancel()

signed-off-by: Gaetan Perrot <[email protected]>
carlescufi pushed a commit that referenced this issue Feb 1, 2024
Implement posix pthread_testcancel()

signed-off-by: Gaetan Perrot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features
Projects
None yet
3 participants