StrandTryExecuteTaskInline Method
Attempts to execute a task inline, but only if this method is
called on the processing thread to avoid parallel execution of tasks.
Namespace: Gemstone.Threading.StrandsAssembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.128 -- Release Build+d4a9a653be1def5888b9be91bb1825c8655f3529
protected override bool TryExecuteTaskInline(
Task task,
bool taskWasPreviouslyQueued
)
Protected Overrides Function TryExecuteTaskInline (
task As Task,
taskWasPreviouslyQueued As Boolean
) As Boolean
protected:
virtual bool TryExecuteTaskInline(
Task^ task,
bool taskWasPreviouslyQueued
) override
function TryExecuteTaskInline(task, taskWasPreviouslyQueued);
- task Task
- The Task to be executed.
- taskWasPreviouslyQueued Boolean
-
A Boolean denoting whether or not task has previously been queued.
If this parameter is True, then the task may have been previously queued (scheduled);
if False, then the task is known not to have been queued,
and this call is being made in order to execute the task inline without queuing it.
BooleanA Boolean value indicating whether the task was executed inline.
Inline execution allows tasks to skip the line and run out of order.
The only reason inline execution is supported at all is to avoid a common
case of deadlocking where a task is queued in advance of another task that it
depends on (via
Wait, for instance). However, deadlocks can
still occur when waiting on tasks scheduled by a different strand. To avoid
out-of-order execution and deadlocks, be very careful about using API calls
that wait on tasks.