work around windows

This commit is contained in:
Jaremy Creechley 2024-05-20 20:06:52 +03:00
parent f5725a8505
commit b4fbe25284
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ proc release*[T](queue: SignalQueuePtr[T]): ?!void =
proc newSignalQueue*[T](maxItems: int = 0): ?!SignalQueuePtr[T] =
## Create a signal queue compatible with Chronos async.
result = success cast[ptr SignalQueue[T]](allocShared0(sizeof(SignalQueue[T])))
without signal =? ThreadSignalPtr.new().mapFailure, err:
let signalRes = ThreadSignalPtr.new().mapFailure
without signal =? signalRes, err:
return failure(err)
result[].signal = signal
result[].chan.open(maxItems)