title: Aliases to mutable thread-local data not allowed
body: <p>I'm new to D and I'm writing a simple multithreaded server for practice. A common paradigm for starting client handler threads in C is to pass the file descriptor of the newly-accept()ed socket into pthread_create(), but D's std.concurrency.spawn() will not allow me to pass the Socket because it's mutable and accessible by two threads.</p>
  
  <p>Of course, I don't actually want an immutable socket (which is why I don't really want to cast it in the main thread unless I have to) - I want to pass a mutable one in and have it go out of scope in the main thread. How would I go about this? Should(/can) I use <code>tid.send(s)</code> to let the thread use the socket? For some reason that seems very clunky to me.</p>
  
  <p>My code now:</p>
  
  <pre><code>void main() {
      Socket listener = new TcpSocket;
      ...
      for (;;) {
          Socket s = listener.accept();
          scope(exit) s.close();
  
          auto tid = spawn(&amp;clientHandler, s);
      }
  }
  
  void clientHandler(Socket s) {
      ...
  }
  </code></pre>
  
  <p>Which produces: Error: static assert  "Aliases to mutable thread-local data not allowed." ... instantiated from here: spawn!(Socket)</p>