I tried for something like this:
import system, os, osproc, threadpool
import locks
var
thr1: Thread[string]
thr2: Thread[string]
L: Lock
proc threadExec(p: string) {.thread.} =
discard execProcess(p)
proc threadQuit {.thread.} =
os.sleep(1000)
quit(1)
initLock(L)
createThread(thr1, threadExec, (paramStr(1)))
createThread(thr2, threadQuit)
joinThreads(thr1,thr2)
quit(1)
Run
To immediately stop parent process after child process execution but, without
responce from childside. So is' there an example of how to implement it
correctly, not like a thread, just mb it's already implemented option.