comparison Implab/Parallels/DispatchPool.cs @ 89:ce0171cacec4 v2

improved performance of a chained map operation
author cin
date Wed, 08 Oct 2014 02:19:45 +0400
parents 2c5631b43c7d
children 4c0e5ef99986
comparison
equal deleted inserted replaced
88:c4877ae77cee 89:ce0171cacec4
67 } 67 }
68 } 68 }
69 69
70 protected abstract bool TryDequeue(out TUnit unit); 70 protected abstract bool TryDequeue(out TUnit unit);
71 71
72 private bool Dequeue(out TUnit unit, int timeout) { 72 bool Dequeue(out TUnit unit, int timeout) {
73 int ts = Environment.TickCount; 73 int ts = Environment.TickCount;
74 if (TryDequeue(out unit)) 74 if (TryDequeue(out unit))
75 return true; 75 return true;
76 lock (m_signal) { 76 lock (m_signal) {
77 while (!TryDequeue(out unit) && m_exit == 0) 77 while (!TryDequeue(out unit) && m_exit == 0)