summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/luv/examples/killing-children.lua
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/luv/examples/killing-children.lua')
-rw-r--r--3rdparty/luv/examples/killing-children.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/3rdparty/luv/examples/killing-children.lua b/3rdparty/luv/examples/killing-children.lua
new file mode 100644
index 00000000000..6aab693d0c1
--- /dev/null
+++ b/3rdparty/luv/examples/killing-children.lua
@@ -0,0 +1,24 @@
+local p = require('lib/utils').prettyPrint
+local uv = require('luv')
+
+
+
+local child, pid
+child, pid = uv.spawn("sleep", {
+ args = {"100"}
+}, function (code, signal)
+ p("EXIT", {code=code,signal=signal})
+ uv.close(child)
+end)
+
+p{child=child, pid=pid}
+
+-- uv.kill(pid, "SIGTERM")
+uv.process_kill(child, "SIGTERM")
+
+repeat
+ print("\ntick.")
+until uv.run('once') == 0
+
+print("done")
+