SmartThreadPool v2.0
This commit is contained in:
Ami Bar
2009-12-19 16:32:41 +02:00
parent b30b4abdda
commit 4d6ffb5851
89 changed files with 13714 additions and 2639 deletions
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Text;
using Amib.Threading;
using NUnit.Framework;
namespace STPTests
{
/// <summary>
/// Summary description for TestCancel.
/// </summary>
[TestFixture]
[Category("TestFuncT")]
public class TestFuncT
{
[Test]
public void FuncT()
{
SmartThreadPool stp = new SmartThreadPool();
IWorkItemResult<int> wir =
stp.QueueWorkItem(new Func<int, int>(f), 1);
int y = wir.GetResult();
Assert.AreEqual(y, 2);
try
{
wir.GetResult();
}
finally
{
stp.Shutdown();
}
}
private int f(int x)
{
return x + 1;
}
}
}