[]
        
(Showing Draft Content)

CSJ2K.j2k.util.ThreadPool.runTarget

runTarget Method

runTarget(IThreadRunnable, object)

Declaration
public virtual bool runTarget(IThreadRunnable t, object l)
Parameters
Type Name Description
IThreadRunnable t
object l
Returns
Type Description
bool

runTarget(IThreadRunnable, object, bool)

Declaration
public virtual bool runTarget(IThreadRunnable t, object l, bool async)
Parameters
Type Name Description
IThreadRunnable t
object l
bool async
Returns
Type Description
bool

runTarget(IThreadRunnable, object, bool, bool)

Runs the run method of the specified target in an idle thread of this pool. When the target's run method completes, the thread waiting on the lock object is notified, if any. If there is currently no idle thread and the asynchronous mode is not used the method will block until a thread of the pool becomes idle or the calling thread is interrupted. If the asynchronous mode is used then the method will not block and will return false.

Declaration
public virtual bool runTarget(IThreadRunnable t, object l, bool async, bool notifyAll)
Parameters
Type Name Description
IThreadRunnable t

The target. The 'run()' method of this object will be run in an idle thread of the pool.

object l

The lock object. A thread waiting on the lock of the 'l' object will be notified, through the 'notify()' call, when the target's run method completes. If null no thread is notified.

bool async

If true the asynchronous mode will be used.

bool notifyAll

If true, threads waiting on the lock of the 'l' object will be notified trough the 'notifyAll()' instead of the normal 'notify()' call. This is not normally needed.

Returns
Type Description
bool

True if the target was submitted to some thread. False if no idle thread could be found and the target was not submitted for execution.