# HG changeset patch # User Frank Benoit # Date 1221211556 -7200 # Node ID ed80c5c2b55001cb301cb7f8eb2737cfce8e62a1 # Parent 9e7e1a8bc8131ec978126211ffd58e520a749bd9 rm unneeded sync diff -r 9e7e1a8bc813 -r ed80c5c2b550 dwtx/dwtxhelper/JThread.d --- a/dwtx/dwtxhelper/JThread.d Fri Sep 12 09:44:36 2008 +0200 +++ b/dwtx/dwtxhelper/JThread.d Fri Sep 12 11:25:56 2008 +0200 @@ -54,15 +54,12 @@ public static JThread currentThread(){ auto res = getTls().val(); if( res is null ){ - synchronized(JThread.classinfo){ - res = getTls().val(); - if( res is null ){ - res = new JThread(); - res.thread = Thread.getThis(); - getTls().val( res ); - } - } + // no synchronized needed + res = new JThread(); + res.thread = Thread.getThis(); + getTls().val( res ); } + assert( res ); return res; } public int getPriority() { @@ -121,6 +118,7 @@ Thread.sleep(time/1000.0); } public Thread nativeThread(){ + assert(thread); return thread; } public override char[] toString(){