public boolean peekEnabled() { if ( init_sem.isReleasedForever()){ return( enabled ); } return( true ); // don't know yet }
public boolean isInitialised() { return( init_complete.isReleasedForever()); }
@Override public boolean isInitialized() { return( initial_search_sem.isReleasedForever()); }
@Override public boolean isInitialising() { return( !init_sem.isReleasedForever()); }
@Override public void runSupport() { if ( !sem.isReleasedForever()){ SESecurityManager.stopThread( thread ); } } });
public boolean setSuspended( final boolean susp ) { if ( !init_sem.isReleasedForever()){ return( false ); }else{ synchronized( this ){ for ( DHTPluginImpl dht: dhts ){ dht.setSuspended( susp ); } } } return( true ); }
@Override public void complete( boolean timeout ) { synchronized( rendezvous_lookup_cache ){ AESemaphore sem = (AESemaphore)entry[1]; if ( !sem.isReleasedForever()){ entry[0] = SystemTime.getMonotonousTime(); sem.releaseForever(); } } } });
@Override public void perform( TimerEvent event ) { List to_close = new ArrayList(); synchronized( connections ){ for (int i=0;i<connections.size();i++){ SESTSConnectionImpl connection = (SESTSConnectionImpl)connections.get(i); if ( connection.crypto_complete.isReleasedForever()){ continue; } long now = SystemTime.getCurrentTime(); if ( connection.create_time > now ){ connection.create_time = now; }else{ int time_allowed = connection.getConnectMethodCount() * CRYPTO_SETUP_TIMEOUT; if ( now - connection.create_time > time_allowed ){ to_close.add( connection ); } } } } for (int i=0;i<to_close.size();i++){ ((SESTSConnectionImpl)to_close.get(i)).reportFailed( new Exception( "Timeout during crypto setup" )); } }
@Override public int getOtherInstanceCount( boolean block_if_needed ) { if ( !block_if_needed ){ if ( !initial_search_sem.isReleasedForever()){ return( 0 ); } } waitForInit(); try{ this_mon.enter(); return( other_instances.size()); }finally{ this_mon.exit(); } }
protected void checkCompletion() { boolean inform = false; synchronized( sessions ){ if ( completion_sem.isReleasedForever()){ return; } if ( destroyed || ( outbound_connections_complete && sessions.size() == 0 )){ inform = true; completion_sem.releaseForever(); } } if ( inform ){ Iterator it = listeners.iterator(); while( it.hasNext()){ try{ ((NetStatusProtocolTesterListener)it.next()).complete( this ); }catch( Throwable e ){ Debug.printStackTrace(e); } } } }
while( !sem.isReleasedForever() && !cancelled ){
private static void checkPluginInstallation( String network, String reason ) { // aznettor was moved from the installer so see if we need to dynamically install it if ( network == null || network == AENetworkClassifier.AT_TOR ) { if ( plugin_init_complete.isReleasedForever()) { if ( CoreFactory.getSingleton().getPluginManager().getPluginInterfaceByID( "aznettor", false ) == null ){ if ( !Constants.isAndroid ) { installTor( reason, "aznettor.install.via.proxy", new boolean[1], null ); } } } } }
@Override public boolean isEnabled() { if ( plugin_interface == null ){ Debug.out( "Called too early!" ); return false; } if ( plugin_interface.isInitialisationThread()){ if ( !init_sem.isReleasedForever()){ Debug.out( "Initialisation deadlock detected" ); return( true ); } } init_sem.reserve(); return( enabled ); }
boolean run_init = !init_complete.isReleasedForever();
if ( !initialisation_complete_sem.isReleasedForever() || ( public_dht_plugin != null && public_dht_plugin.isInitialising())){
if ( crypto_complete.isReleasedForever()){
if ( !initialisation_complete_sem.isReleasedForever() || ( public_dht_plugin != null && public_dht_plugin.isInitialising())){
if ( !initialisation_complete_sem.isReleasedForever() || ( public_dht_plugin != null && public_dht_plugin.isInitialising())){
if ( !initialisation_complete_sem.isReleasedForever() || ( public_dht_plugin != null && public_dht_plugin.isInitialising())){
if ( !initialisation_complete_sem.isReleasedForever() || ( public_dht_plugin != null && public_dht_plugin.isInitialising())){