Run()
Contents
[
Hide
]System::Threading::Tasks::Run(const Action<>&) function
Queues the specified work to run on the thread pool and returns a Task handle for that work.
TaskPtr System::Threading::Tasks::Run(const Action<> &action)
Arguments
| Parameter | Type | Description |
|---|---|---|
| action | const Action<>& | The work to execute asynchronously. |
Return Value
A Task that represents the work queued to execute in the thread pool.
System::Threading::Tasks::Run(const Action<>&, const CancellationToken&) function
Queues the specified work to run on the thread pool and returns a Task handle for that work.
TaskPtr System::Threading::Tasks::Run(const Action<> &action, const CancellationToken &cancellationToken)
Arguments
| Parameter | Type | Description |
|---|---|---|
| action | const Action<>& | The work to execute asynchronously. |
| cancellationToken | const CancellationToken& | A cancellation token that can be used to cancel the work if it has not yet started. |
Return Value
A Task that represents the work queued to execute in the thread pool.
System::Threading::Tasks::Run(const Func<TaskPtr>&) function
Queues the specified work to run on the thread pool and returns a proxy for the Task returned by the function.
TaskPtr System::Threading::Tasks::Run(const Func<TaskPtr> &function)
Arguments
| Parameter | Type | Description |
|---|---|---|
| function | const Func<TaskPtr>& | The work to execute asynchronously, which returns a Task. |
Return Value
A Task that represents a proxy for the Task returned by the function.
System::Threading::Tasks::Run(const Func<TResult>&) function
Queues the specified work to run on the thread pool and returns a Task
template<typename TResult> RTaskPtr<TResult> System::Threading::Tasks::Run(const Func<TResult> &function)
Template parameters
| Parameter | Description |
|---|---|
| TResult | The type of the result returned by the task. |
Arguments
| Parameter | Type | Description |
|---|---|---|
| function | const Func<TResult>& | The work to execute asynchronously. |
Return Value
A Task
See Also
- Typedef TaskPtr
- Typedef Action
- Typedef RTaskPtr
- Class CancellationToken
- Class Func
- Namespace System::Threading::Tasks
- Library Aspose.Slides