public void runProcessor( TRTrackerServerProcessorTCP processor ) { thread_pool.run( processor ); }
public static void getOffOfSWTThread(AERunnable runnable) { tp.run(runnable); }
public threadPoolWorker run(AERunnable runnable) { return( run(runnable, false, false)); }
private void start() { thread_pool.run( new AERunnable() { @Override public void runSupport() { try{ sniff(); }finally{ synchronized( HTTPAuthHelper.this ){ processors.remove( processor.this ); } } } }); }
@Override public void deletePortMapping( final boolean tcp, final int port ) throws UPnPException { thread_pool.run( new AERunnable() { @Override public void runSupport() { try{ nat_impl.deletePortMapping( tcp, port ); }catch( UPnPException e ){ e.printStackTrace(); } } }); }
@Override public void addPortMapping( final boolean tcp, final int port, final String description ) throws UPnPException { thread_pool.run( new AERunnable() { @Override public void runSupport() { try{ nat_impl.addPortMapping( tcp, port, description ); }catch( UPnPException e ){ e.printStackTrace(); } } }); }
@Override public void rootLost( final InetAddress local_address, final String usn ) { // we need to take this operation off the main thread as it can take some time device_dispatcher.run( new AERunnable() { @Override public void runSupport() { UPnPRootDeviceImpl root_device = null; try{ rd_listeners_mon.enter(); root_device = (UPnPRootDeviceImpl)root_locations.remove( usn ); }finally{ rd_listeners_mon.exit(); } if ( root_device == null ){ return; } log( "UPnP: root lost: usn=" + usn + ", location=" + root_device.getLocation() + ", ni=" + root_device.getNetworkInterface().getName() + ",local=" + root_device.getLocalAddress().toString()); root_device.destroy( false ); } }); }
external_lookup_pool.run( new DhtTask(external_lookup_pool)
@Override public void runSupport() { if ( prepareForKeepAlive( true )){ keep_alive_pool.run( new AERunnable() { @Override public void runSupport() { GenericMessageConnectionIndirect.this.keepAlive(); } }); } } });
protected void runScrapes( final ArrayList<TRTrackerScraperResponseImpl> responses, final boolean force, boolean async) { numActiveScrapes.incrementAndGet(); if ( async ){ thread_pool.run( new AERunnable() { @Override public void runSupport() { runScrapesSupport( responses, force ); } }); if (Logger.isEnabled()) { Logger.log(new LogEvent(LOGID, "TrackerStatus: queuing '" + scrapeURL + "', for " + responses.size() + " of " + hashes.size() + " hashes" + ", single_hash_scrapes: " + (bSingleHashScrapes ? "Y" : "N") + ", queue size=" + thread_pool.getQueueSize())); } }else{ runScrapesSupport( responses, force ); } }
tp.run( new AERunnable()
@Override public void runSupport() { while(true){ check_queue_sem.reserve(); ThreadPoolTask task; try{ check_queue_mon.enter(); task = (ThreadPoolTask)check_queue.remove(0); }finally{ check_queue_mon.exit(); } try{ thread_pool.run( task ); }catch( Throwable e ){ Debug.printStackTrace( e ); } } } };
pool.run( new AERunnable()
keep_alive_pool.run( new AERunnable()
thread_pool.run( new TRTrackerServerProcessorUDP( this, socket, packet ));
device_dispatcher.run( new AERunnable()
thread_pool.run(event_to_run.getRunnable());
@Override public void run() { long failed_accepts = 0; while(true){ try{ Socket socket = ss.accept(); failed_accepts = 0; thread_pool.run( new httpFilter( socket )); }catch( Throwable e ){ failed_accepts++; if (Logger.isEnabled()) Logger.log(new LogEvent(LOGID, "ClientIDManager: listener failed on port " + filter_port, e )); if ( failed_accepts > 10 ){ // looks like its not going to work... // some kind of socket problem Logger.logTextResource(new LogAlert(LogAlert.UNREPEATABLE, LogAlert.AT_ERROR, "Network.alert.acceptfail"), new String[] { "" + filter_port, "TCP" }); use_filter = false; break; } } } } }.start();
thread_pool.run( new AERunnable()
starting = true; start_pool.run( new AERunnable()