title: How does Thread() work in Kotlin?
body: <p>I wanted to execute a task inside a thread and wrote the following code:</p>
  
  <pre><code>Thread().run {
      Log.i("TEST", "in thread")
      Thread.sleep(5000);
      transactionStatus = ApiFactory.getInstance().transactionService.abortTransaction()
      synchronized(TestTransactionPayAbort.lock) {
          TestTransactionPayAbort.lock.notify()
      }
  }
  
  Log.i("TEST", "main")
  synchronized(TestTransactionPayAbort.lock) {
      TestTransactionPayAbort.lock.wait()
  }
  </code></pre>
  
  <p>According to the debugger, before executing <code>Thread().run{}</code>, I'm inside thread 4.
  After executing <code>Thread.sleep()</code>, the debugger tells me that thread 4 is sleeping whereas I was expecting to see that thread 5 is sleeping. About the <code>Log()</code>: I see immediately <em>in thread</em> and <em>main</em> 5 seconds later.</p>
  
  <p>What is my mistake here?</p>