From 9986d22c7158f08433db292bb51b7f6053a547e4 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Mon, 20 May 2024 19:23:53 +0300 Subject: [PATCH] fix nim c -r /Users/elcritch/projs/status/nim-codex/tests/codex/slots/testprover.nim --- codex/slots/proofs/backends/asynccircoms.nim | 4 ++++ codex/utils/asyncthreads.nim | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/codex/slots/proofs/backends/asynccircoms.nim b/codex/slots/proofs/backends/asynccircoms.nim index 4084f078..8d3675b2 100644 --- a/codex/slots/proofs/backends/asynccircoms.nim +++ b/codex/slots/proofs/backends/asynccircoms.nim @@ -1,6 +1,7 @@ import std/options import pkg/taskpools +import pkg/chronicles import pkg/chronos import pkg/chronos/threadsync import pkg/questionable/results @@ -10,6 +11,9 @@ import ../../../utils/asyncthreads import ./circomcompat +logScope: + topics = "codex asyncprover" + type AsyncCircomCompat* = object circom*: CircomCompat tp*: Taskpool diff --git a/codex/utils/asyncthreads.nim b/codex/utils/asyncthreads.nim index 6e5be522..271e0910 100644 --- a/codex/utils/asyncthreads.nim +++ b/codex/utils/asyncthreads.nim @@ -22,8 +22,11 @@ proc release*[T](queue: SignalQueuePtr[T]): ?!void = queue[].chan.close() if err =? queue[].signal.close().mapFailure.errorOption(): queue[].signal = nil - result = failure(err.msg) - deallocShared(queue) + deallocShared(queue) + return failure(err.msg) + else: + deallocShared(queue) + return success() proc newSignalQueue*[T](maxItems: int = 0): ?!SignalQueuePtr[T] = ## Create a signal queue compatible with Chronos async.