summary refs log tree commit diff stats
path: root/tests/stdlib/tcasts.nim
Commit message (Expand)AuthorAgeFilesLines
* fixes #19101; zero initialization union casts (#22185)ringabout2023-06-291-0/+26
;43030857+ringabout@users.noreply.github.com> 2023-04-21 21:37:58 +0800 committer GitHub <noreply@github.com> 2023-04-21 15:37:58 +0200 stdlib tests now check refc too (#21664)' href='/ahoang/Nim/commit/tests/stdlib/tuserlocks.nim?h=devel&id=4fa86422c057ae0615a6f06a6fd0a538e1bce029'>4fa86422c ^
78cbb52fa ^

5c5f35634 ^
3d2f0e2c7 ^
78cbb52fa ^






5c5f35634 ^






78cbb52fa ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
           
                               

   
                 
                     






                       






                  
               
discard """
  matrix: "--mm:refc; --mm:orc"
"""

import std/rlocks
import std/assertions

var r: RLock
r.initRLock()
doAssert r.tryAcquire()
doAssert r.tryAcquire()
r.release()
r.release()

block:
  var x = 12
  withRLock r:
    inc x
  doAssert x == 13

r.deinitRLock()