private void WorkWithoutReentry(TestSession session) { using (_sentry = Guard.AgainstReEntry(_sentry)) { session.DoWork(); } }
public static GuardAgainstReentry AgainstReEntryExpected(GuardAgainstReentry guard) { if (guard != null) { guard.EnterExpected(); return(guard); } return(new GuardAgainstReentry()); }
private void WorkWithReentry(TestSession session, int count) { using (_sentry = Guard.AgainstReEntry(_sentry)) { session.DoWork(); if (count == 0) { WorkWithReentry(session, count + 1); } } }
private void WorkWithReentryExpected(TestSession session, int count) { using (_sentry = Guard.AgainstReEntryExpected(_sentry)) { if (_sentry.HasEntered) return; session.DoWork(); if (count == 0) { WorkWithReentryExpected(session, count + 1); } } }
public void SetUp() { _sentry = null; }