Example #1
0
        // Token: 0x060001CA RID: 458 RVA: 0x0000BA88 File Offset: 0x00009C88
        internal AmDatabaseOperationQueue GetOperationQueueByGuid(Guid guid, bool isCreateIfNotExist)
        {
            AmDatabaseOperationQueue amDatabaseOperationQueue = null;

            lock (this.m_locker)
            {
                if ((!this.m_dbMap.TryGetValue(guid, out amDatabaseOperationQueue) || amDatabaseOperationQueue == null) && isCreateIfNotExist)
                {
                    amDatabaseOperationQueue = new AmDatabaseOperationQueue(guid);
                    this.m_dbMap[guid]       = amDatabaseOperationQueue;
                }
            }
            return(amDatabaseOperationQueue);
        }
Example #2
0
        // Token: 0x060001CB RID: 459 RVA: 0x0000BAF0 File Offset: 0x00009CF0
        internal bool Enqueue(AmDbOperation opr)
        {
            bool result = false;

            lock (this.m_locker)
            {
                if (this.IsEnabled)
                {
                    AmDatabaseOperationQueue operationQueueByGuid = this.GetOperationQueueByGuid(opr.Database.Guid, true);
                    result = operationQueueByGuid.Add(opr, false);
                }
                else
                {
                    opr.Cancel();
                }
            }
            return(result);
        }
Example #3
0
        // Token: 0x060001CC RID: 460 RVA: 0x0000BB5C File Offset: 0x00009D5C
        internal bool Enqueue(Guid dbGuid, List <AmDbOperation> oprList, bool checkIfQueueIsIdle)
        {
            bool result = false;

            lock (this.m_locker)
            {
                if (this.IsEnabled)
                {
                    AmDatabaseOperationQueue operationQueueByGuid = this.GetOperationQueueByGuid(dbGuid, true);
                    result = operationQueueByGuid.Add(oprList, checkIfQueueIsIdle);
                }
                else
                {
                    foreach (AmDbOperation amDbOperation in oprList)
                    {
                        amDbOperation.Cancel();
                    }
                }
            }
            return(result);
        }
Example #4
0
 // Token: 0x060001C9 RID: 457 RVA: 0x0000B944 File Offset: 0x00009B44
 internal void Stop()
 {
     lock (this.m_locker)
     {
         this.IsEnabled = false;
         foreach (Guid key in this.m_dbMap.Keys)
         {
             AmDatabaseOperationQueue amDatabaseOperationQueue = this.m_dbMap[key];
             amDatabaseOperationQueue.IsEnabled = false;
             if (amDatabaseOperationQueue.OperationServiced != null)
             {
                 amDatabaseOperationQueue.OperationServiced.Cancel();
             }
         }
     }
     for (;;)
     {
         bool flag2 = false;
         lock (this.m_locker)
         {
             foreach (Guid key2 in this.m_dbMap.Keys)
             {
                 AmDatabaseOperationQueue amDatabaseOperationQueue2 = this.m_dbMap[key2];
                 if (!amDatabaseOperationQueue2.IsIdle)
                 {
                     flag2 = true;
                     break;
                 }
             }
         }
         if (!flag2)
         {
             break;
         }
         Thread.Sleep(50);
     }
 }