This commit is contained in:
flywind 2021-03-16 14:14:56 +08:00 • committed by GitHub
commit d5eb658034
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -456,7 +456,8 @@ proc `=`*[T](dest: var Channel[T], src: Channel[T]) =
proc channelSend[T](chan: Channel[T], data: sink T, size: int, nonBlocking: bool): bool {.inline.} = proc channelSend[T](chan: Channel[T], data: sink T, size: int, nonBlocking: bool): bool {.inline.} =
## Send item to the channel (FIFO queue) ## Send item to the channel (FIFO queue)
## (Insert at last) ## (Insert at last)
sendMpmc(chan.d, data.unsafeAddr, size, nonBlocking) result = sendMpmc(chan.d, data.unsafeAddr, size, nonBlocking)
wasMoved(data)
proc channelReceive[T](chan: Channel[T], data: ptr T, size: int, nonBlocking: bool): bool {.inline.} = proc channelReceive[T](chan: Channel[T], data: ptr T, size: int, nonBlocking: bool): bool {.inline.} =
## Receive an item from the channel ## Receive an item from the channel