Returns true if a unit of work was processed within the timeout, or false if the timeout expired prior to a unit of work completion.
Syntax
Visual Basic (Declaration) | |
---|
Public Overloads Function PerformWork( _
ByVal timeout As Integer _
) As Boolean |
Parameters
- timeout
Example
Library/Library.Test/TestWaitAndContinue.cs
C# | Copy Code |
---|
WaitAndContinueList work = new WaitAndContinueList();
SampleWork item = new SampleWork();
Assert.IsFalse(item.Disposed);
work.AddWork(item);
Assert.IsFalse(work.PerformWork(0));
item.Dispose();
Assert.IsFalse(work.PerformWork(0));
item.Completed = true;//Normally this would be set in the Dispose method of the WorkItem, but we are testing
Assert.IsFalse(work.PerformWork(0));
Assert.IsTrue(work.IsEmpty);
Assert.IsTrue(item.Disposed); |
VB.NET | Copy Code |
---|
Dim work As New WaitAndContinueList()
Dim item As New SampleWork()
Assert.IsFalse(item.Disposed)
work.AddWork(item)
Assert.IsFalse(work.PerformWork(0))
item.Dispose()
Assert.IsFalse(work.PerformWork(0))
item.Completed = True
'Normally this would be set in the Dispose method of the WorkItem, but we are testing
Assert.IsFalse(work.PerformWork(0))
Assert.IsTrue(work.IsEmpty)
Assert.IsTrue(item.Disposed) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also