mirror of
https://github.com/farcasclaudiu/SmartThreadPool.git
synced 2026-06-22 09:01:19 +03:00
Changed Monitor.TryEnter(...) to lock(...) {}
This commit is contained in:
@@ -178,9 +178,8 @@ namespace Amib.Threading.Internal
|
||||
WaiterEntry waiterEntry;
|
||||
WorkItem workItem = null;
|
||||
|
||||
try
|
||||
lock (this)
|
||||
{
|
||||
while (!Monitor.TryEnter(this)) { }
|
||||
//Stopwatch stopwatch = Stopwatch.StartNew();
|
||||
//Monitor.Enter(this);
|
||||
//stopwatch.Stop();
|
||||
@@ -202,10 +201,6 @@ namespace Amib.Threading.Internal
|
||||
// Put the waiter with the other waiters
|
||||
PushWaiter(waiterEntry);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
|
||||
// Prepare array of wait handle for the WaitHandle.WaitAny()
|
||||
WaitHandle [] waitHandles = new WaitHandle[] {
|
||||
|
||||
Reference in New Issue
Block a user