Untested but what about:
    
    
    type
      X = ref object
        a: string
    
    var g: X
    
    proc foreign {.thread.} =
      var local = X(a: "abc")
      g = move local
    
    spawn foreign()
    # g now has an X
    
    
    Run

Reply via email to