Date: Fri, 19 Apr 2024 13:07:21 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 278459] Add pthread_sigqueue() Message-ID: <bug-278459-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278459 Bug ID: 278459 Summary: Add pthread_sigqueue() Product: Base System Version: 14.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: vini.ipsmaker@gmail.com Linux and Solaris 11 offer pthread_sigqueue(3) that is to sigqueue(2) what pthread_kill(3) is to kill(2). I've been using pthread_sigqueue() on my own software to offer different "cancellation paths". To illustrate my need, he= re is the piece of the code that I want to be cancellable: https://gitlab.com/emilua/emilua/-/blob/v0.7.1/src/file.cpp#L520-532 As you can see, I use setjmp() for a switch expression that will allow me to jump to different cancel-handling paths. Here's the cancellation type-1: https://gitlab.com/emilua/emilua/-/blob/v0.7.1/src/file.cpp#L463 Here's cancellation type-2: https://gitlab.com/emilua/emilua/-/blob/v0.7.1/src/file.cpp#L93 Both cancellators just use pthread_sigqueue(). Cancellator type-1 will use sigval::sival_int=3D1 and cancellator type-2 will use sigval::sival_int=3D2= . The sighandler (SA_SIGINFO) will use this value as an argument to longjmp(): https://gitlab.com/emilua/emilua/-/blob/v0.7.1/src/core.cpp#L756 Can FreeBSD have pthread_sigqueue() as in Linux and Solaris? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-278459-227>