I triple checked it. 2.0.48 has problems with this, 2.040, 2.045 & 2.047 don't.

> This will throw exception on trying to create socket in derived thread. 
> Socket created in main thread is ok. Is it some shared issue or... ? I have 
> been trying to find something info in docs and mailing list but no result.
> 
> import std.stdio;
> import core.thread;
> import std.socket;
> 
> class MyThread : Thread {
>   Socket sock;
>   this(){
>     super(&run);
>   }
>   void run(){
>     writeln("thread start");
>     sock = new TcpSocket; // this will throw exception on 2.047, 2.048
>     writeln("thread end");
>   }
> }
> 
> void main(){
>   writeln("main start");
>   auto s = new TcpSocket;
>   writeln("socket in main thread created");
>   auto t = new MyThread;
>   t.start;
>   writeln("main end");
> }

Reply via email to