mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-08 16:43:10 +00:00
move assert into lock
This commit is contained in:
parent
b2cb1fd371
commit
0fde28a994
@ -44,11 +44,12 @@ proc release*(self: var Semaphore) {.inline.} =
|
||||
if self.count <= 0:
|
||||
self.count += 1
|
||||
self.cond.signal()
|
||||
self.lock.release()
|
||||
|
||||
doAssert not (self.count > self.size),
|
||||
"Semaphore count is greather than size: " & $self.size & " count is: " & $self.count
|
||||
|
||||
self.lock.release()
|
||||
|
||||
template withSemaphore*(self: var Semaphore, body: untyped) =
|
||||
self.acquire()
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user