Esempio n. 1
0
        public object Get(string ID = null)
        {
            ID = ThreadedLocker.CheckID(ID);

            lock (Lock)
            {
                if (!Data.ContainsKey(ID))
                {
                    if (lockIndexer >= _MaxLocks)
                    {
                        throw new Exception("ThreadedLocker.Get exception, locks limit exhausted, maximum of " + _MaxLocks + "locks");
                    }

                    Data.Add(ID, lockIndexer, true);
                    Locks[lockIndexer] = new object();
                    ++lockIndexer;
                }

                return(Locks[Data[ID]]);
            }
        }