Put more thought into new signaling code

This commit is contained in:
Justine Tunney 2024-09-19 20:13:55 -07:00
parent 6107eb38f9
commit f68fc1f815
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
10 changed files with 127 additions and 51 deletions

View file

@ -29,6 +29,17 @@
* The impact of this action can be terminating the process, or
* interrupting it to request something happen.
*
* On Windows, signals are delivered between processes using shared
* memory files stored in C:\ProgramData\cosmo\sig\x\y.pid which hold
* the process signal mask. Any process that can access these files can
* signal a cosmo process. The targeting process will then notice that a
* signal has been added and delivers to any thread as soon as possible.
*
* On Windows, the concept of a process group isn't fully implemented.
* Saying `kill(0, sig)` will deliver `sig` to all direct descendent
* processes. Saying `kill(-pid, sig)` will be the same as saying
* `kill(pid, sig)`.
*
* @param pid can be:
* >0 signals one process by id
* =0 signals all processes in current process group