mirror of
https://github.com/logos-storage/apatheia.git
synced 2026-02-12 00:53:07 +00:00
cleanup
This commit is contained in:
parent
00d6ff5c21
commit
b270d986c6
@ -12,8 +12,8 @@ export chronos
|
||||
|
||||
type ChanPtr[T] = ptr Channel[T]
|
||||
|
||||
proc allocSharedChannel[T](): ChanPtr[T] =
|
||||
cast[ChanPtr[T]](allocShared0(sizeof(Channel[T])))
|
||||
proc allocPtr[T](): ptr T =
|
||||
cast[ptr T](allocShared0(sizeof(T)))
|
||||
|
||||
type SignalQueue*[T] = object
|
||||
signal: ThreadSignalPtr
|
||||
@ -32,7 +32,7 @@ proc newSignalQueue*[T](
|
||||
if res.isErr():
|
||||
raise newException(ApatheiaSignalErr, res.error())
|
||||
result.signal = res.get()
|
||||
result.chan = allocSharedChannel[T]()
|
||||
result.chan = allocPtr[Channel[T]]()
|
||||
result.chan[].open(maxItems)
|
||||
|
||||
proc send*[T](c: SignalQueue[T], msg: sink T): Result[void, string] {.raises: [].} =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user