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:
return failure(exc.msg)
without wasSent =? queue[].signal.fireSync(InfiniteDuration).mapFailure, err:
return failure(err)
if wasSent:
let res = queue[].signal.fireSync(InfiniteDuration).mapFailure()
if res.isErr:
return failure(res.error())
if res.get():
return ok()
else:
return failure("ThreadSignalPtr not signalled in time")