private static void QueueItem(InfoTaskType t, PathFinderAgent agent, Action callBackDelegate, InfoTemplateAbstract template) { template.AddCallBack(callBackDelegate); template.AddCallBack(() => { lock (_infoExtraction[(int)t]) _infoExtraction[(int)t].Remove(agent); }); WaitCallback templateCallBack = new WaitCallback(InfoExtractionThreadWorker); DataPair pair = new DataPair(template, templateCallBack); lock (_infoExtraction[(int)t]) _infoExtraction[(int)t].Add(agent, pair); ThreadPool.QueueUserWorkItem(templateCallBack, template); }
private static bool ContainsKey(InfoTaskType t, PathFinderAgent agent) { return(_infoExtraction[(int)t].ContainsKey(agent)); }