work around windows - no without

This commit is contained in:
Jaremy Creechley 2024-05-20 21:45:03 +03:00
parent 9dcf56b5f5
commit b2b8a0ce84
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
1 changed files with 4 additions and 3 deletions

View File

@ -48,9 +48,10 @@ proc send*[T](queue: SignalQueuePtr[T], msg: T): ?!void {.raises: [].} =
except Exception as exc: except Exception as exc:
return failure(exc.msg) return failure(exc.msg)
without wasSent =? queue[].signal.fireSync(InfiniteDuration).mapFailure, err: let res = queue[].signal.fireSync(InfiniteDuration).mapFailure()
return failure(err) if res.isErr:
if wasSent: return failure(res.error())
if res.get():
return ok() return ok()
else: else:
return failure("ThreadSignalPtr not signalled in time") return failure("ThreadSignalPtr not signalled in time")