Fix a bug with starting of asynchronous processes (#18464)
The asynchronous process completion handler callback should be called only once. This is achieved by passing `WT_EXECUTEONLYONCE` flag to the `registerWaitForSingleObject` Windows API procedure. Related to cheatfate/asynctools#35
This commit is contained in:
parent
0e44d137f9
commit
86f5a56fcd
1 changed files with 1 additions and 1 deletions
|
|
@ -1022,7 +1022,7 @@ when defined(windows) or defined(nimdoc):
|
||||||
raiseOSError(osLastError())
|
raiseOSError(osLastError())
|
||||||
|
|
||||||
var pcd = cast[PostCallbackDataPtr](allocShared0(sizeof(PostCallbackData)))
|
var pcd = cast[PostCallbackDataPtr](allocShared0(sizeof(PostCallbackData)))
|
||||||
var flags = WT_EXECUTEINWAITTHREAD.DWORD
|
var flags = WT_EXECUTEINWAITTHREAD.DWORD or WT_EXECUTEONLYONCE.DWORD
|
||||||
|
|
||||||
proc proccb(fd: AsyncFD, bytesCount: DWORD, errcode: OSErrorCode) =
|
proc proccb(fd: AsyncFD, bytesCount: DWORD, errcode: OSErrorCode) =
|
||||||
closeWaitable(hProcess)
|
closeWaitable(hProcess)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue