You can use code like this:
    
    
    var mainThread = getThreadId()
    
    proc foobar =
      ## This needs to be called by the main thread:
      assert getThreadId() == mainThread
    
    
    
    Run

Reply via email to