public void Act() { Job j = _op.GetObject(); _nStatsLock.EnterWriteLock(); try { _waitOn.Remove(j.JobName); string node = j.GetAtt("workNode"); var nd = _nStatsDic[node]; var l = new List <string>(nd.PendingWork); l.Remove(j.JobName); var newNodeDesc = new NodeDescription(node, l); _nStatsDic[node] = newNodeDesc; _nStats.Remove(nd); _nStats.Add(newNodeDesc); } finally { _nStatsLock.ExitWriteLock(); } lock (_results) { _results.Add(j); } }
private void Push(Job j) { string node = _pusher.Push(j); _nStatsLock.EnterWriteLock(); try { _waitingOn.Add(j.JobName, j); var nd = _nodeStatsDic[node]; var l = new List <string>(nd.PendingWork) { j.JobName }; var newNodeDesc = new NodeDescription(node, l); _nodeStatsDic[node] = newNodeDesc; _nodeStats.Remove(nd); _nodeStats.Add(newNodeDesc); } finally { _nStatsLock.ExitWriteLock(); } }