try{ instance_mon.enter(); if ( instances.get(0) == instance ){ return( true ); } }finally{ instance_mon.exit(); } try{ Thread.sleep( 250 ); }catch( Throwable e ){ } return( false );
try{ instance_mon.enter(); instances.add( helper ); }finally{ instance_mon.exit(); }
try{ instance_mon.enter(); instances.remove( instance ); }finally{ instance_mon.exit(); }