从
Process.kill
的文档:
Sends the given signal to the specified process id(s) if pid is
positive. If pid is zero signal is sent to all processes whose group
ID is equal to the group ID of the process. signal may be an integer
signal number or a POSIX signal name (either with or without a SIG
prefix). If signal is negative (or starts with a minus sign),kills
process groups instead of processes. Not all signals are available
on all platforms.
好的,那很模糊.在哪些平台上可以获得哪些信号? Windows上是否有可用的信号?
(我之前在Windows上尝试过Process.kill(9,pid)并且它没有抛出错误.虽然它没有杀死进程…但是Process.kill(“TERM”,pid)确实抛出错误. 去搞清楚.)