Skip to content

Commit

Permalink
asyncprocmonitor now compiles in win
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed Sep 6, 2024
1 parent ffbde11 commit 108bca6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions asyncprocmonitor.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Monitor a client process and shutdown the current process, if the client
# process is found to be dead

import os, chronos, utils
import os, chronos, utils, sugar

when defined(posix):
import posix_utils
Expand All @@ -12,11 +12,10 @@ type Callback* = proc() {.closure, gcsafe, raises: [].}
when defined(windows):
import winlean

when defined(windows):
proc hookAsyncProcMonitor*(pid: int, cb: Callback) =
addProcess(pid, cb)
proc hookAsyncProcMonitor*(pid: int, cb: Callback) = discard
addProcess2(pid, (arg: pointer) => cb())

when defined(posix):
elif defined(posix):
proc hookAsyncProcMonitor*(pid: int, cb: Callback) =
var processExitCallbackCalled = false

Expand Down

0 comments on commit 108bca6

Please sign in to comment.