Added refactorings suggested by Simon Cropp

This commit is contained in:
Ami Bar
2009-12-19 17:33:30 +02:00
parent 1bd7e4d104
commit d2c14da5ad
62 changed files with 785 additions and 1131 deletions
+3 -10
View File
@@ -1,5 +1,4 @@
using System;
using System.Threading;
using NUnit.Framework;
@@ -31,8 +30,8 @@ namespace SmartThreadPoolTests
SmartThreadPool stp = new SmartThreadPool();
stp.OnThreadInitialization += new ThreadInitializationHandler(OnInitialization);
stp.OnThreadTermination += new ThreadTerminationHandler(OnTermination);
stp.OnThreadInitialization += OnInitialization;
stp.OnThreadTermination += OnTermination;
stp.QueueWorkItem(new WorkItemCallback(DoSomeWork), null);
@@ -72,13 +71,7 @@ namespace SmartThreadPoolTests
[ThreadStatic]
private static ThreadContextState _threadContextState;
private int _counter = 0;
public int Counter
{
get { return _counter; }
set { _counter = value; }
}
public int Counter { get; set; }
// Static member so it can be used anywhere in code of the work item method
public static ThreadContextState Current