mirror of
https://github.com/farcasclaudiu/SmartThreadPool.git
synced 2026-06-22 07:01:18 +03:00
Renamed method AbortOnWorkItemOnCancel to AbortOnWorkItemCancel
This commit is contained in:
@@ -201,12 +201,12 @@ namespace SmartThreadPoolTests
|
||||
/// 2. Queue work item that takes some time
|
||||
/// 3. Wait for it to start
|
||||
/// 4. Cancel the work item (soft)
|
||||
/// 5. Call to AbortOnWorkItemOnCancel
|
||||
/// 5. Call to AbortOnWorkItemCancel
|
||||
/// 5. Wait for the STP to get idle
|
||||
/// 6. Make sure nothing ran in the work item after the AbortOnWorkItemOnCancel
|
||||
/// 6. Make sure nothing ran in the work item after the AbortOnWorkItemCancel
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void CancelInProgressWorkItemSoftWithAbortOnWorkItemOnCancel()
|
||||
public void CancelInProgressWorkItemSoftWithAbortOnWorkItemCancel()
|
||||
{
|
||||
bool abortFailed = false;
|
||||
ManualResetEvent waitToStart = new ManualResetEvent(false);
|
||||
@@ -217,7 +217,7 @@ namespace SmartThreadPoolTests
|
||||
state => {
|
||||
waitToStart.Set();
|
||||
waitToCancel.WaitOne();
|
||||
SmartThreadPool.AbortOnWorkItemOnCancel();
|
||||
SmartThreadPool.AbortOnWorkItemCancel();
|
||||
abortFailed = true;
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -125,12 +125,12 @@ namespace SmartThreadPoolTests
|
||||
/// 2. Queue work item that takes some time
|
||||
/// 3. Wait for it to start
|
||||
/// 4. Cancel the work item (soft)
|
||||
/// 5. Call to AbortOnWorkItemOnCancel
|
||||
/// 5. Call to AbortOnWorkItemCancel
|
||||
/// 5. Wait for the STP to get idle
|
||||
/// 6. Make sure nothing ran in the work item after the AbortOnWorkItemOnCancel
|
||||
/// 6. Make sure nothing ran in the work item after the AbortOnWorkItemCancel
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TimeoutInProgressWorkItemSoftWithAbortOnWorkItemOnCancel()
|
||||
public void TimeoutInProgressWorkItemSoftWithAbortOnWorkItemCancel()
|
||||
{
|
||||
bool abortFailed = false;
|
||||
ManualResetEvent waitToStart = new ManualResetEvent(false);
|
||||
@@ -143,7 +143,7 @@ namespace SmartThreadPoolTests
|
||||
{
|
||||
waitToStart.Set();
|
||||
Thread.Sleep(1000);
|
||||
SmartThreadPool.AbortOnWorkItemOnCancel();
|
||||
SmartThreadPool.AbortOnWorkItemCancel();
|
||||
abortFailed = true;
|
||||
return null;
|
||||
});
|
||||
|
||||
@@ -1347,7 +1347,7 @@ namespace Amib.Threading
|
||||
/// Checks if the work item has been cancelled, and if yes then abort the thread.
|
||||
/// Can be used with Cancel and timeout
|
||||
/// </summary>
|
||||
public static void AbortOnWorkItemOnCancel()
|
||||
public static void AbortOnWorkItemCancel()
|
||||
{
|
||||
if (IsWorkItemCanceled)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user