Basic |
The BasicWorkItem type exposes the following members.
| Name | Description | |
|---|---|---|
| BasicWorkItem | Standard constructor | |
| BasicWorkItem(Boolean) | Allowing to abort is disabled per default since thread aborting results in unstable system state, see http://msdn.microsoft.com/en-us/magazine/cc163644.aspx : [..] "I'll caution you against using Thread.Abort to control the lifetime of a thread, especially if you have little knowledge about the implementation of the code you're aborting. An abort inside of a critical region could spell disaster for an entire AppDomain, and while a polite abort does signficantly reduce the window of disaster to very tiny slivers, that one time out of 1,000 could lead to a deadlock or resource leak or worse." |
| Name | Description | |
|---|---|---|
| AllowAbortUponExceedingTimeLimit | Whether to allow aborting the HandleWorkItem method if the maximum busy time exceeded. Per default this value is true. | |
| IsTerminated | This property is set to true if the work item was terminated before it finished processing, this may happen e.g. if AllowAbortUponExceedingTimeLimit was true. | |
| MaxBusyTime | The maximum time a workItem may be busy until it is aborted. Must be > 0 to be taken into account. | |
| Result | The result of the work item | |
| Tag | A work item can be tagged to be distinguishable from other items |
| Name | Description | |
|---|---|---|
| DoWork | This method is called from HandleWorkItem when the work item is processed. May set Result if the operation returned a result | |
| HandleWorkItem | Calls HandleWorkItem method, then after the call to the method returns, issues the event WorkDone if assigned | |
| Terminate | Sets the state of the item (IsTerminated to true), issues the Terminated event if assigned. | |
| ToString |
Returns the Tag as string.
(Overrides ObjectToString) |
| Name | Description | |
|---|---|---|
| Terminated | This event occurs if the item terminated before it finished processing. IsTerminated and AllowAbortUponExceedingTimeLimit | |
| WorkDone | Register to this event to get notified when the item HandleWorkItem method has finished. |