Top Inners Fields Constructors Methods
com.mchange.v2.async

public Class SimpleRunnableQueue

extends Object
implements RunnableQueue, Queuable
Class Inheritance
All Implemented Interfaces
com.mchange.v2.async.Queuable, com.mchange.v2.async.AsynchronousRunner, com.mchange.v1.util.ClosableResource, com.mchange.v2.async.RunnableQueue
Imports
java.util.List, .LinkedList

Deprecated

CarefulRunnableQueue is better.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
pack-priv boolean
private Thread
t

private List<E>

Constructor Summary

AccessConstructor and Description
public
SimpleRunnableQueue(boolean daemon)

public

Method Summary

Modifier and TypeMethod and Description
public RunnableQueue
private synchronized void
public synchronized void
close(boolean
Should be regarded as a hint, not a guarantee. If true, pending, not-yet-performed tasks will be skipped, if possible. Currently executing tasks may or may not be interrupted. If false, all previously scheduled tasks will be completed prior to clean-up. The method returns immediately regardless.
skip_remaining_tasks
)

Implements com.mchange.v2.async.AsynchronousRunner.close.

Finish with this AsynchronousRunner, and clean-up any Threads or resources it may hold.

public synchronized void
close()

Implements com.mchange.v2.async.AsynchronousRunner.close.

Clean-up resources held by this asynchronous runner as soon as possible.

private synchronized Runnable
public synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

gentle_close_requestedback to summary
pack-priv boolean gentle_close_requested
tback to summary
private Thread t
taskListback to summary
private List<E> taskList

Constructor Detail

SimpleRunnableQueueback to summary
public SimpleRunnableQueue(boolean daemon)
SimpleRunnableQueueback to summary
public SimpleRunnableQueue()

Method Detail

asRunnableQueueback to summary
public RunnableQueue asRunnableQueue()

Implements com.mchange.v2.async.Queuable.asRunnableQueue.

awaitTaskback to summary
private synchronized void awaitTask() throws InterruptedException
closeback to summary
public synchronized void close(boolean skip_remaining_tasks)

Implements com.mchange.v2.async.AsynchronousRunner.close.

Doc from com.mchange.v2.async.AsynchronousRunner.close.

Finish with this AsynchronousRunner, and clean-up any Threads or resources it may hold.

Parameters
skip_remaining_tasks:boolean

Should be regarded as a hint, not a guarantee. If true, pending, not-yet-performed tasks will be skipped, if possible. Currently executing tasks may or may not be interrupted. If false, all previously scheduled tasks will be completed prior to clean-up. The method returns immediately regardless.

closeback to summary
public synchronized void close()

Implements com.mchange.v2.async.AsynchronousRunner.close.

Doc from com.mchange.v2.async.AsynchronousRunner.close.

Clean-up resources held by this asynchronous runner as soon as possible. Remaining tasks are skipped if possible, and any tasks executing when close() is called may or may not be interrupted. Equivalent to close( true ).

dequeueRunnableback to summary
private synchronized Runnable dequeueRunnable()
postRunnableback to summary
public synchronized void postRunnable(Runnable r)

Implements com.mchange.v2.async.AsynchronousRunner.postRunnable.

com.mchange.v2.async back to summary

pack-priv Class SimpleRunnableQueue.TaskThread

extends Thread
Class Inheritance

Field Summary

Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Constructor Detail

TaskThreadback to summary
pack-priv TaskThread()

Method Detail

runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.