mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
* add test for #15584 * Rename userlocks.nim to trlocks.nim * add bug comment * improve cmd * reference bugfix, not bug * add test that runs rlocks * disallow joining joining with other test cases (e.g., a test case that invokes `RLock.initRLock()`) may cause this test to compile, when the goal is to test if these lines can be compiled in isolation
14 lines
196 B
Nim
14 lines
196 B
Nim
discard """
|
|
cmd: "nim $target --threads:on $options $file"
|
|
"""
|
|
|
|
import rlocks
|
|
|
|
var r: RLock
|
|
r.initRLock()
|
|
doAssert r.tryAcquire()
|
|
doAssert r.tryAcquire()
|
|
r.release()
|
|
r.release()
|
|
r.deinitRLock()
|