ComponentOne PDF for .NET
CSJ2K.j2k.util Namespace / ThreadPool Class / runTarget Method / runTarget(IThreadRunnable,Object,Boolean,Boolean) Method
The target. The 'run()' method of this object will be run in an idle thread of the pool.
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.
If true the asynchronous mode will be used.
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.

In This Topic
    runTarget(IThreadRunnable,Object,Boolean,Boolean) Method
    In This Topic
    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.
    Syntax
    'Declaration
     
    
    Public Overloads Overridable Function runTarget( _
       ByVal t As IThreadRunnable, _
       ByVal l As Object, _
       ByVal async As Boolean, _
       ByVal notifyAll As Boolean _
    ) As Boolean
    public virtual bool runTarget( 
       IThreadRunnable t,
       object l,
       bool async,
       bool notifyAll
    )

    Parameters

    t
    The target. The 'run()' method of this object will be run in an idle thread of the pool.
    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.
    async
    If true the asynchronous mode will be used.
    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.

    Return Value

    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.
    See Also