# CSJ2K.j2k.util.ThreadPool.runTarget

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_util_ThreadPool_runTarget_" data-uid="CSJ2K.j2k.util.ThreadPool.runTarget*">runTarget Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_util_ThreadPool_runTarget_" data-uid="CSJ2K.j2k.util.ThreadPool.runTarget*"></a>
<h4 id="CSJ2K_j2k_util_ThreadPool_runTarget_IThreadRunnable_System_Object_" data-uid="CSJ2K.j2k.util.ThreadPool.runTarget(IThreadRunnable,System.Object)">runTarget(IThreadRunnable, object)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual bool runTarget(IThreadRunnable t, object l)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function runTarget(t As IThreadRunnable, l As Object) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.WPF.ReportViewer.4.6.2.IThreadRunnable.html">IThreadRunnable</a></td>
      <td><span class="parametername">t</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">l</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="CSJ2K_j2k_util_ThreadPool_runTarget_" data-uid="CSJ2K.j2k.util.ThreadPool.runTarget*"></a>
<h4 id="CSJ2K_j2k_util_ThreadPool_runTarget_IThreadRunnable_System_Object_System_Boolean_" data-uid="CSJ2K.j2k.util.ThreadPool.runTarget(IThreadRunnable,System.Object,System.Boolean)">runTarget(IThreadRunnable, object, bool)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual bool runTarget(IThreadRunnable t, object l, bool async)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function runTarget(t As IThreadRunnable, l As Object, async As Boolean) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.WPF.ReportViewer.4.6.2.IThreadRunnable.html">IThreadRunnable</a></td>
      <td><span class="parametername">t</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">l</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">async</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="CSJ2K_j2k_util_ThreadPool_runTarget_" data-uid="CSJ2K.j2k.util.ThreadPool.runTarget*"></a>
<h4 id="CSJ2K_j2k_util_ThreadPool_runTarget_IThreadRunnable_System_Object_System_Boolean_System_Boolean_" data-uid="CSJ2K.j2k.util.ThreadPool.runTarget(IThreadRunnable,System.Object,System.Boolean,System.Boolean)">runTarget(IThreadRunnable, object, bool, bool)</h4>
<div class="markdown level1 summary"><p>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.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual bool runTarget(IThreadRunnable t, object l, bool async, bool notifyAll)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Function runTarget(t As IThreadRunnable, l As Object, async As Boolean, notifyAll As Boolean) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.WPF.ReportViewer.4.6.2.IThreadRunnable.html">IThreadRunnable</a></td>
      <td><span class="parametername">t</span></td>
      <td><p>The target. The 'run()' method of this object will be run in
an idle thread of the pool.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">l</span></td>
      <td><p>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.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">async</span></td>
      <td><p>If true the asynchronous mode will be used.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">notifyAll</span></td>
      <td><p>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.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p>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.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
