Wiki Navigation
- Loading...
The WorkState enumeration is used as a status indicator for workload by the threadpool. The following states are possible:
- INIT - This state is set by the class that implements the IWork interface, indicating the workload has not been submitted yet to the ThreadPool.
- INQUEUE - As soon as workload enters the ThreadPool, the state is set to INQUEUE.
- CANCELED - State which is used by the Work and ThreadPool class to skip work that's canceled. Setting the WorkState of an object which implements the IWork interface to this state effectively cancel's the processing of the workload as long as the threadpool hasn't started processing the workload yet. Once workload is being processed, there's no way of cancelling the workload.
- INPROGRESS - The WorkState property of the workload changes to INPROGRESS as soon as the threadpool picks up the workload from the work queue and starts processing it.
- FINISHED - The WorkState property of the workload changes to FINISHED as soon as the threadpool has finished processing the workload.
- ERROR - The WorkState property of the workload is set to this state if any unhandled exception has occurred while processing the workload.

This page has no comments.