Beispiel #1
0
        /// <summary>
        /// Adds new or gets an existig latch.
        /// </summary>
        /// <param name="objectType"></param>
        /// <param name="fullObjectPath"></param>
        /// <returns></returns>
        public Latch AddOrGet(ObjectType objectType, string logicalSchemaPath)
        {
            string lookupKey = Utility.FileSystemPathToKey(logicalSchemaPath);

            if (Catalog.ContainsKey(lookupKey))
            {
                return(Catalog[lookupKey]);
            }
            else
            {
                Latch latch = new Latch(logicalSchemaPath)
                {
                    ObjectType = objectType
                };

                Catalog.Add(lookupKey, latch);

                return(latch);
            }
        }
Beispiel #2
0
 public LatchKey(Latch latch, Transaction transaction, LatchMode mode)
 {
     Latch       = latch;
     Transaction = transaction;
     Mode        = mode;
 }