Skip to content

Commit

Permalink
Update channels.nim (#17717)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Apr 14, 2021
1 parent 67e28c0 commit 58f44c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/std/channels.nim
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ proc sendUnbufferedMpmc(chan: ChannelRaw, data: sink pointer, size: int, nonBloc

chan.head = 1

release(chan.headLock)
signal(chan.notEmptyCond)
release(chan.headLock)
result = true

proc sendMpmc(chan: ChannelRaw, data: sink pointer, size: int, nonBlocking: bool): bool =
Expand Down Expand Up @@ -343,8 +343,8 @@ proc sendMpmc(chan: ChannelRaw, data: sink pointer, size: int, nonBlocking: bool
if chan.tail == 2 * chan.size:
chan.tail = 0

release(chan.tailLock)
signal(chan.notEmptyCond)
release(chan.tailLock)
result = true

proc recvUnbufferedMpmc(chan: ChannelRaw, data: pointer, size: int, nonBlocking: bool): bool =
Expand All @@ -368,8 +368,8 @@ proc recvUnbufferedMpmc(chan: ChannelRaw, data: pointer, size: int, nonBlocking:

chan.head = 0

release(chan.headLock)
signal(chan.notFullCond)
release(chan.headLock)
result = true

proc recvMpmc(chan: ChannelRaw, data: pointer, size: int, nonBlocking: bool): bool =
Expand Down Expand Up @@ -404,8 +404,8 @@ proc recvMpmc(chan: ChannelRaw, data: pointer, size: int, nonBlocking: bool): bo
if chan.head == 2 * chan.size:
chan.head = 0

release(chan.headLock)
signal(chan.notFullCond)
release(chan.headLock)
result = true

proc channelCloseMpmc(chan: ChannelRaw): bool =
Expand Down

0 comments on commit 58f44c8

Please sign in to comment.