Thread auxiliary type: basictask v2

Source: Internet
Author: User

Update content:

Add the basictaskrequeststate enumeration to specify the current request status.

Deletes the Request status of some basictaskstates. This function is implemented by basictaskrequeststate.

In this way, after a task has a status request, but before the task waits for awakening, The Request status of the task can be changed without restriction. After the task is awakened, the final request status will be applied.

 

For example, in V1, a running task, after the pause command is executed, the task status is called request pause. At this moment, the actual task status is still running, but you cannot stop the task, the Stop command can be executed only when the request is paused and then continues. However, in V2, The Request status is separated from the actual status. Therefore, a task in the paused status of a request can be immediately changed to the stopped request (and vice versa ).

 

Run the idisposable interface for the basictask type of V2.

The basictask of V2 allows you to stop a paused task directly. This is not allowed in V1.

 

V2 demo (the task status and the task request status are separated)

 

Current versionSource codeDownload

Note: This is an archive of Microsoft SkyDrive. Please download it directly in your browser. Some download tools may not be available for download.

ExampleProgramRunning Environment:. NET Framework 4.0 client profile

SourceCodeEnvironment: Visual Studio 2010

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.