Example #1
0
        // Token: 0x06001D45 RID: 7493 RVA: 0x00084110 File Offset: 0x00082310
        public override Result ShipAction(long logfileNumber)
        {
            StateLock stateLock = null;

            if (this.m_fUseSuspendLock)
            {
                stateLock = this.Config.ReplayState.SuspendLock;
                LockOwner lockOwner;
                if (!stateLock.TryEnter(LockOwner.Component, false, out lockOwner))
                {
                    ExTraceGlobals.LogInspectorTracer.TraceDebug((long)this.GetHashCode(), "unable to get SuspendLock, restarting the instance");
                    if (lockOwner != LockOwner.AttemptCopyLastLogs)
                    {
                        ExTraceGlobals.LogInspectorTracer.TraceDebug <LockOwner>((long)this.GetHashCode(), "unable to get SuspendLock, current owner: {0}, stopping the instance", lockOwner);
                        this.m_setBroken.RestartInstanceSoon(true);
                    }
                    else
                    {
                        this.m_setBroken.RestartInstanceSoon(false);
                    }
                    return(Result.LongWaitRetry);
                }
            }
            Result result;

            try
            {
                result = (this.InspectLog(logfileNumber, true) ? Result.Success : Result.GiveUp);
            }
            finally
            {
                if (stateLock != null)
                {
                    stateLock.Leave(LockOwner.Component);
                }
            }
            return(result);
        }
 internal static void AddSuspendLock(StateLock suspendLock)
 {
     SuspendLockTable.s_suspendLocks.AddInstance(suspendLock);
 }
 internal static bool TryGetSuspendLock(string identity, out StateLock suspendLock)
 {
     return(SuspendLockTable.s_suspendLocks.TryGetInstance(identity, out suspendLock));
 }
 internal static void RemoveInstance(StateLock suspendLock)
 {
     SuspendLockTable.s_suspendLocks.RemoveInstance(suspendLock);
 }