mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-19 17:10:30 +00:00
Overhaul Windows signal handling
The new asynchronous signal delivery technique is now also being used for tkill(), raise(), etc. Many subtle issues have been addresesd. We now signal handling on Windows that's remarkably similar to the POSIX behaviors. However that's just across threads. We're lacking a way to have the signal semantics work well, across multiple WIN32 processes.
This commit is contained in:
parent
8bdaddd81d
commit
99dc1281f5
38 changed files with 635 additions and 279 deletions
|
@ -16,6 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/bo.internal.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/sig.internal.h"
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
|
@ -25,9 +26,9 @@
|
|||
#include "libc/sysv/consts/timer.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
||||
textwindows int sys_clock_nanosleep_nt(int clock, int flags,
|
||||
const struct timespec *req,
|
||||
struct timespec *rem) {
|
||||
static textwindows int sys_clock_nanosleep_nt_impl(int clock, int flags,
|
||||
const struct timespec *req,
|
||||
struct timespec *rem) {
|
||||
struct timespec now, abs;
|
||||
if (flags & TIMER_ABSTIME) {
|
||||
abs = *req;
|
||||
|
@ -55,3 +56,13 @@ textwindows int sys_clock_nanosleep_nt(int clock, int flags,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
textwindows int sys_clock_nanosleep_nt(int clock, int flags,
|
||||
const struct timespec *req,
|
||||
struct timespec *rem) {
|
||||
int rc;
|
||||
BEGIN_BLOCKING_OPERATION;
|
||||
rc = sys_clock_nanosleep_nt_impl(clock, flags, req, rem);
|
||||
END_BLOCKING_OPERATION;
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue