sched/pthread: Implement pthread_sigqueue - #20197
Conversation
|
|
@linguini1 yes, you need to add it to syscall.csv, this file works like a database that is used to create the syscall when compiling NuttX to protected mode and kernel mode. |
bde1e1f to
84ce51b
Compare
|
@acassis should Also, I see that the function signature is causing problems. All the other syscall definitions have arguments which are pointers or ints, but |
Good point, there are only some pthread_* at syscall but all pthread functions are listed at libs/libc/libc.csv: I think it is a good idea to add it there |
Implements the pthread_sigqueue Linux extension to pthreads. Follows a similar implementation to sigqueue, except targeting a specific thread through nxsig_dispatch. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Documents the new implementation of pthread_sigqueue. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
84ce51b to
e621dfb
Compare
cederom
left a comment
There was a problem hiding this comment.
Thank you @linguini1 :-)
We may want to add test app in pair to nuttx-apps? :-)
Might be a little while until I get to that, but I'd be happy to add one to OSTest or whatever we use for testing pthreads at some point in the near future. |
Summary
Implements the
pthread_sigqueuefunction.docs/pthread: Document pthread_sigqueue
Documents the new implementation of pthread_sigqueue.
sched/pthread: Implement pthread_sigqueue
Implements the pthread_sigqueue Linux extension to pthreads. Follows a similar implementation to sigqueue, except targeting a specific thread through nxsig_dispatch.
Impact
Closes #20163.
Users can now queue signals to pthreads using this Linux extension interface.
Testing
Tested using a custom application which uses a pthread to handle POSIX timer events. When it is time to clean up the thread,
pthread_sigqueueis used to sendSIGABRTwhich kills the thread.Main program cancelling thread:
Thread logic:
Log output: