From ce12d0f3f9c70c88457729ec28eb9ef755ff3af0 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Mon, 20 May 2024 20:23:43 +0300 Subject: [PATCH] work around windows --- codex/utils/asyncthreads.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codex/utils/asyncthreads.nim b/codex/utils/asyncthreads.nim index 2d5e67d0..314ff2be 100644 --- a/codex/utils/asyncthreads.nim +++ b/codex/utils/asyncthreads.nim @@ -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: [].} =