// Token: 0x060001C1 RID: 449 RVA: 0x0000B5DC File Offset: 0x000097DC internal bool Add(AmDbOperation op, bool checkIfQueueIdle) { bool flag = false; if (!this.IsEnabled) { op.Cancel(); return(false); } lock (this.m_locker) { if (!checkIfQueueIdle || this.IsIdle) { AmTrace.Debug("AmDatabaseOperationQueue: Add operation {0} into the queue. checkIfQueueIdle:{1}, IsIdle:{2}", new object[] { op.ToString(), checkIfQueueIdle, this.IsIdle }); this.AddNoLock(op); flag = true; } else { AmTrace.Debug("AmDatabaseOperationQueue: Skip operation {0}. checkIfQueueIdle:{1}, IsIdle:{2}", new object[] { op.ToString(), checkIfQueueIdle, this.IsIdle }); this.LogQueueInfo(op); } if (!flag) { op.Cancel(); } } return(flag); }
// 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); }
// Token: 0x060001C3 RID: 451 RVA: 0x0000B79C File Offset: 0x0000999C internal void PerformAction(object context) { AmDbOperation amDbOperation = null; for (;;) { lock (this.m_locker) { if (this.m_queue.Count <= 0) { this.m_operationServiced = null; this.m_isInUse = false; break; } amDbOperation = this.m_queue.Dequeue(); this.m_operationServiced = amDbOperation; } if (this.IsEnabled) { bool flag2 = true; try { amDbOperation.ReportStatus(amDbOperation.Database, AmDbActionStatus.Started); this.RunOperation(amDbOperation); amDbOperation.ReportStatus(amDbOperation.Database, AmDbActionStatus.Completed); flag2 = false; continue; } finally { if (flag2) { amDbOperation.ReportStatus(amDbOperation.Database, AmDbActionStatus.Failed); } } } amDbOperation.Cancel(); } }