Skip to content

posix: implement pthread_kill() #59943

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

Open
Tracked by #51211
ycsin opened this issue Jul 3, 2023 · 3 comments · May be fixed by #74918
Open
Tracked by #51211

posix: implement pthread_kill() #59943

ycsin opened this issue Jul 3, 2023 · 3 comments · May be fixed by #74918
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 function implementations, pthread_kill() is one of them.

pthread_kill - send a signal to a thread

The pthread_kill() function shall request that a signal be delivered to the specified thread.

As in kill(), if sig is zero, error checking shall be performed but no signal shall actually be sent.

See https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.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 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
@AbhinavMir
Copy link
Contributor

AbhinavMir commented Jan 18, 2024

I'm thinking of doing this in a generic POSIX way, lmk if this sounds right: pthread_t can be converted into an index, with which we find the corresponding k_thread in the posix_thread_pool, and then send a signal to that thread. I'm just wondering how can I "send" a signal to the thread. SIGTERM or SIGKILL are the usual signals, but is there a signal handler in POSIX I can interact with? I see there is one in shell but I don't know if that's where I'm supposed to be looking. Any hints @ycsin ?

@cfriedt
Copy link
Member

cfriedt commented Jan 18, 2024

@AbhinavMir - I have a draft Pr for this already. It might make sense to attempt a different enhancement issue.

@AbhinavMir
Copy link
Contributor

Makes sense, thank you

@cfriedt cfriedt linked a pull request Jun 25, 2024 that will close this issue
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
Development

Successfully merging a pull request may close this issue.

4 participants