work around windows

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

View File

@ -31,10 +31,10 @@ 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])))
let signalRes = ThreadSignalPtr.new().mapFailure
without signal =? signalRes, err:
return failure(err)
result[].signal = signal
let sigRes = ThreadSignalPtr.new()
if sigRes.isErr():
return failure(sigRes.error())
result[].signal = sigRes.get()
result[].chan.open(maxItems)
proc send*[T](queue: SignalQueuePtr[T], msg: T): ?!void {.raises: [].} =