summary refs log blame commit diff stats
path: root/tests/threads/tthreadheapviolation1.nim
blob: 379bd55e65206852ee7676b7b674bb1660ef5b61 (plain) (tree)
1
2
3
4
5
6
7
8
9
           
                                       
          
                                                           

   
   
                                
                 






                                         
                               
             
discard """
  errormsg: "'horrible' is not GC-safe"
  line: 11
  cmd: "nim $target --hints:on --threads:on $options $file"
"""

var
  global: string = "test string"
  t: Thread[void]

proc horrible() {.thread.} =
  global = "string in thread local heap!"
  var x = global
  var mydata = (x, "my string too")
  echo global

createThread[void](t, horrible)
joinThread(t)