/// <inheritdoc /> public void Dispose() { switch (this.action) { case CookieAction.None: break; case CookieAction.ExitReadLock: [email protected](); DeadlockMonitor.ExitAcquired(this.parent.@lock, readLock); break; case CookieAction.ExitWriteLock: [email protected](); DeadlockMonitor.ExitAcquired(this.parent.@lock, writeLock); break; case CookieAction.ExitWriteAndUpgradeableReadLock: [email protected](); [email protected](); DeadlockMonitor.ExitAcquired(this.parent.@lock, writeLock); DeadlockMonitor.ExitAcquired(this.parent.@lock, upgradableReadLock); break; case CookieAction.EnterWriteLock: DeadlockMonitor.EnterWaiting(this.parent.@lock, readLock, this.parent.lockedObject); DeadlockMonitor.EnterWaiting(this.parent.@lock, writeLock, this.parent.lockedObject); DeadlockMonitor.EnterWaiting(this.parent.@lock, upgradableReadLock, this.parent.lockedObject); if ([email protected](WarningTimeout)) { Debug.Print("Reacquiring a write lock on {0} from thread {1} ({2}) is taking longer than expected.", this.parent.lockedObject, Thread.CurrentThread.ManagedThreadId, Thread.CurrentThread.Name); DeadlockMonitor.DetectDeadlocks(); [email protected](); } DeadlockMonitor.ConvertWaitingToAcquired(this.parent.@lock, writeLock, this.parent.lockedObject); DeadlockMonitor.ExitWaiting(this.parent.@lock, readLock); DeadlockMonitor.ExitWaiting(this.parent.@lock, upgradableReadLock); break; case CookieAction.ExitUpgrableReaderLock: [email protected](); DeadlockMonitor.ExitAcquired(this.parent.@lock, upgradableReadLock); break; } this.action = CookieAction.None; GC.SuppressFinalize(this); }
public static extern void zfb_editCookie(int id, NativeCookie cookie, CookieAction action);
/// <inheritdoc /> public void Dispose() { switch ( this.action ) { case CookieAction.None: break; case CookieAction.ExitReadLock: [email protected](); DeadlockMonitor.ExitAcquired( this.parent.@lock, readLock ); break; case CookieAction.ExitWriteLock: [email protected](); DeadlockMonitor.ExitAcquired( this.parent.@lock, writeLock ); break; case CookieAction.ExitWriteAndUpgradeableReadLock: [email protected](); [email protected](); DeadlockMonitor.ExitAcquired( this.parent.@lock, writeLock ); DeadlockMonitor.ExitAcquired( this.parent.@lock, upgradableReadLock ); break; case CookieAction.EnterWriteLock: DeadlockMonitor.EnterWaiting( this.parent.@lock, readLock, this.parent.lockedObject ); DeadlockMonitor.EnterWaiting( this.parent.@lock, writeLock, this.parent.lockedObject ); DeadlockMonitor.EnterWaiting( this.parent.@lock, upgradableReadLock, this.parent.lockedObject ); if ( [email protected]( WarningTimeout ) ) { Debug.Print( "Reacquiring a write lock on {0} from thread {1} ({2}) is taking longer than expected.", this.parent.lockedObject, Thread.CurrentThread.ManagedThreadId, Thread.CurrentThread.Name ); DeadlockMonitor.DetectDeadlocks(); [email protected](); } DeadlockMonitor.ConvertWaitingToAcquired( this.parent.@lock, writeLock, this.parent.lockedObject ); DeadlockMonitor.ExitWaiting( this.parent.@lock, readLock ); DeadlockMonitor.ExitWaiting( this.parent.@lock, upgradableReadLock ); break; case CookieAction.ExitUpgrableReaderLock: [email protected](); DeadlockMonitor.ExitAcquired( this.parent.@lock, upgradableReadLock ); break; } this.action = CookieAction.None; GC.SuppressFinalize( this ); }
internal Cookie( CookieAction action, ReaderWriterLockWrapper parent, StackTrace stackTrace ) { this.action = action; this.parent = parent; this.stackTrace = stackTrace; }
internal Cookie(CookieAction action, ReaderWriterLockWrapper parent, StackTrace stackTrace) { this.action = action; this.parent = parent; this.stackTrace = stackTrace; }