deprecated old locking effects

This commit is contained in:
Araq
2014-12-08 08:42:18 +01:00
parent c7664e7025
commit 08fcc87986

View File

@@ -16,12 +16,15 @@ type
## or not is unspecified!
TCond* = TSysCond ## Nim condition variable
LockEffect* = object of RootEffect ## effect that denotes that some lock operation
## is performed
AquireEffect* = object of LockEffect ## effect that denotes that some lock is
## aquired
ReleaseEffect* = object of LockEffect ## effect that denotes that some lock is
## released
LockEffect* {.deprecated.} = object of RootEffect ## \
## effect that denotes that some lock operation
## is performed. Deprecated, do not use anymore!
AquireEffect* {.deprecated.} = object of LockEffect ## \
## effect that denotes that some lock is
## aquired. Deprecated, do not use anymore!
ReleaseEffect* {.deprecated.} = object of LockEffect ## \
## effect that denotes that some lock is
## released. Deprecated, do not use anymore!
{.deprecated: [FLock: LockEffect, FAquireLock: AquireEffect,
FReleaseLock: ReleaseEffect].}
@@ -33,15 +36,15 @@ proc deinitLock*(lock: var TLock) {.inline.} =
## Frees the resources associated with the lock.
deinitSys(lock)
proc tryAcquire*(lock: var TLock): bool {.tags: [AquireEffect].} =
proc tryAcquire*(lock: var TLock): bool =
## Tries to acquire the given lock. Returns `true` on success.
result = tryAcquireSys(lock)
proc acquire*(lock: var TLock) {.tags: [AquireEffect].} =
proc acquire*(lock: var TLock) =
## Acquires the given lock.
acquireSys(lock)
proc release*(lock: var TLock) {.tags: [ReleaseEffect].} =
proc release*(lock: var TLock) =
## Releases the given lock.
releaseSys(lock)