public static void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) { if (code == null) { throw new ArgumentNullException(nameof(code)); } if (backoutCode == null) throw new ArgumentNullException(nameof(backoutCode)); }
public static void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, object?userData) { ArgumentNullException.ThrowIfNull(code); ArgumentNullException.ThrowIfNull(backoutCode); bool exceptionThrown = true; try { code(userData); exceptionThrown = false; } finally { backoutCode(userData, exceptionThrown); } }
public static void ExecuteCodeWithGuaranteedCleanup( TryCode code, CleanupCode backoutCode, Object userData) { var exceptionThrown = false; try { code.Invoke(userData); } catch { exceptionThrown = true; } backoutCode.Invoke(userData, exceptionThrown); }
public static void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, object? userData) { if (code == null) throw new ArgumentNullException(nameof(code)); if (backoutCode == null) throw new ArgumentNullException(nameof(backoutCode)); bool exceptionThrown = true; try { code(userData); exceptionThrown = false; } finally { backoutCode(userData, exceptionThrown); } }
// [MonoTODO("Currently a no-op")] public static void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) { }
public static void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, object userData) { throw new NotImplementedException(); }
internal ExecuteWithLockHelper(Object lockObject, TryCode userCode, object userState) { m_lockObject = lockObject; m_userCode = userCode; m_userState = userState; }
internal static void ExecuteCodeWithLock(Object lockObject, TryCode code, object userState) { ExecuteWithLockHelper execHelper = new ExecuteWithLockHelper(lockObject, code, userState); ExecuteCodeWithGuaranteedCleanup(s_EnterMonitor, s_ExitMonitor, execHelper); }
public static extern void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, object?userData);
public static extern void ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData);
internal static void ExecuteCodeWithLock(object lockObject, TryCode code, object userState) { ExecuteWithLockHelper userData = new ExecuteWithLockHelper(lockObject, code, userState); ExecuteCodeWithGuaranteedCleanup(s_EnterMonitor, s_ExitMonitor, userData); }
internal ExecuteWithLockHelper(Object lockObject, TryCode userCode, object userState) { m_lockObject = lockObject; m_userCode = userCode; m_userState = userState; }