mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 00:27:26 -05:00
#30 WIP on using the new apache mina library
This commit is contained in:
@@ -59,14 +59,10 @@ public class ThreadPoolManager
|
||||
TimeUnit unit )
|
||||
throws RejectedExecutionException
|
||||
{
|
||||
if( mExecutor == null )
|
||||
{
|
||||
mExecutor = Executors.newScheduledThreadPool( THREAD_POOL_SIZE,
|
||||
new NamingThreadFactory( "sdrtrunk" ) );
|
||||
}
|
||||
ScheduledExecutorService executorService = getScheduledExecutorService();
|
||||
|
||||
ScheduledFuture<?> task =
|
||||
mExecutor.scheduleAtFixedRate( command, 0, period, unit );
|
||||
executorService.scheduleAtFixedRate( command, 0, period, unit );
|
||||
|
||||
mTasks.put( task, type );
|
||||
|
||||
@@ -76,13 +72,9 @@ public class ThreadPoolManager
|
||||
public void scheduleOnce( Runnable command, long delay, TimeUnit unit )
|
||||
throws RejectedExecutionException
|
||||
{
|
||||
if( mExecutor == null )
|
||||
{
|
||||
mExecutor = Executors.newScheduledThreadPool( THREAD_POOL_SIZE,
|
||||
new NamingThreadFactory( "sdrtrunk" ) );
|
||||
}
|
||||
ScheduledExecutorService executorService = getScheduledExecutorService();
|
||||
|
||||
mExecutor.schedule( command, delay, unit );
|
||||
executorService.schedule( command, delay, unit );
|
||||
}
|
||||
|
||||
public boolean cancel( ScheduledFuture<?> task )
|
||||
|
||||
Reference in New Issue
Block a user