mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-09 15:17:24 -05:00
P25 work in progress - final check-in of channel state and activity summary processing of TSBK and PDU messages and event generation.
This commit is contained in:
@@ -38,7 +38,7 @@ public class ThreadPoolManager
|
||||
{
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> schedule( ThreadType type,
|
||||
public ScheduledFuture<?> scheduleFixedRate( ThreadType type,
|
||||
Runnable command,
|
||||
long period,
|
||||
TimeUnit unit )
|
||||
@@ -66,6 +66,25 @@ public class ThreadPoolManager
|
||||
|
||||
}
|
||||
|
||||
public void scheduleOnce( Runnable command, long delay, TimeUnit unit )
|
||||
throws RejectedExecutionException
|
||||
{
|
||||
if( mExecutor == null )
|
||||
{
|
||||
mExecutor = Executors.newScheduledThreadPool( THREAD_POOL_SIZE );
|
||||
}
|
||||
|
||||
if( mTasks.size() <= MAX_TASK_COUNT )
|
||||
{
|
||||
mExecutor.schedule( command, delay, unit );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RejectedExecutionException( "Cannot schedule task - at "
|
||||
+ "max task count [" + mTasks.size() + "]" );
|
||||
}
|
||||
}
|
||||
|
||||
public void cancel( ScheduledFuture<?> task )
|
||||
{
|
||||
task.cancel( true );
|
||||
|
||||
Reference in New Issue
Block a user