work around windows
This commit is contained in:
parent
b4fbe25284
commit
ce12d0f3f9
|
@ -31,10 +31,10 @@ proc release*[T](queue: SignalQueuePtr[T]): ?!void =
|
||||||
proc newSignalQueue*[T](maxItems: int = 0): ?!SignalQueuePtr[T] =
|
proc newSignalQueue*[T](maxItems: int = 0): ?!SignalQueuePtr[T] =
|
||||||
## Create a signal queue compatible with Chronos async.
|
## Create a signal queue compatible with Chronos async.
|
||||||
result = success cast[ptr SignalQueue[T]](allocShared0(sizeof(SignalQueue[T])))
|
result = success cast[ptr SignalQueue[T]](allocShared0(sizeof(SignalQueue[T])))
|
||||||
let signalRes = ThreadSignalPtr.new().mapFailure
|
let sigRes = ThreadSignalPtr.new()
|
||||||
without signal =? signalRes, err:
|
if sigRes.isErr():
|
||||||
return failure(err)
|
return failure(sigRes.error())
|
||||||
result[].signal = signal
|
result[].signal = sigRes.get()
|
||||||
result[].chan.open(maxItems)
|
result[].chan.open(maxItems)
|
||||||
|
|
||||||
proc send*[T](queue: SignalQueuePtr[T], msg: T): ?!void {.raises: [].} =
|
proc send*[T](queue: SignalQueuePtr[T], msg: T): ?!void {.raises: [].} =
|
||||||
|
|
Loading…
Reference in New Issue