[std/rlocks]add inline pragma (#17773)

so that it can be used as the base of new locks module with destructors.
This commit is contained in:
flywind
2021-04-19 13:41:50 +08:00
committed by GitHub
parent 5042cb956b
commit 172a5ab7f8

View File

@@ -33,15 +33,15 @@ proc deinitRLock*(lock: var RLock) {.inline.} =
## Frees the resources associated with the lock.
deinitSys(lock)
proc tryAcquire*(lock: var RLock): bool =
proc tryAcquire*(lock: var RLock): bool {.inline.} =
## Tries to acquire the given lock. Returns `true` on success.
result = tryAcquireSys(lock)
proc acquire*(lock: var RLock) =
proc acquire*(lock: var RLock) {.inline.} =
## Acquires the given lock.
acquireSys(lock)
proc release*(lock: var RLock) =
proc release*(lock: var RLock) {.inline.} =
## Releases the given lock.
releaseSys(lock)