Enabled explicitly unknown lock levels (#5409)
* enabled explicitly unknown lock levels * allowing "unknown" as locks pragma * added test case for locks pragma * updated docs on locks pragma
This commit is contained in:
parent
363b1c0a41
commit
ce4587d7b7
3 changed files with 39 additions and 1 deletions
13
tests/pragmas/tlocks.nim
Normal file
13
tests/pragmas/tlocks.nim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
type SomeBase* = ref object of RootObj
|
||||
type SomeDerived* = ref object of SomeBase
|
||||
memberProc*: proc ()
|
||||
|
||||
method testMethod(g: SomeBase) {.base, locks: "unknown".} = discard
|
||||
method testMethod(g: SomeDerived) =
|
||||
if g.memberProc != nil:
|
||||
g.memberProc()
|
||||
|
||||
# ensure int literals still work
|
||||
proc plain*() {.locks: 0.} =
|
||||
discard
|
||||
Loading…
Add table
Add a link
Reference in a new issue