Пример #1
0
        public Chisler GetCalcValue(int threadId, CalcRequestEnum сalcRequest)
        {
            Chisler result;

            lock (SyncRoot)
            {
                result = GetСalcValues(сalcRequest).SingleOrDefault(ch => ch.ThreadId == threadId);
                if (result == null)
                {
                    result = new Chisler {
                        ThreadId = threadId, Value = 1
                    };
                    GetСalcValues(сalcRequest).Add(result);
                }
            }

            return(result);
        }
Пример #2
0
 public void PutToBug(Chisler value)
 {
     _mqBug.TryAdd(value.ThreadId, value);
 }