예제 #1
0
		private void WorkWithoutReentry(TestSession session)
		{
			using (_sentry = Guard.AgainstReEntry(_sentry))
			{
				session.DoWork();
			}
		}
예제 #2
0
 public static GuardAgainstReentry AgainstReEntryExpected(GuardAgainstReentry guard)
 {
     if (guard != null)
     {
         guard.EnterExpected();
         return(guard);
     }
     return(new GuardAgainstReentry());
 }
예제 #3
0
		private void WorkWithReentry(TestSession session, int count)
		{
			using (_sentry = Guard.AgainstReEntry(_sentry))
			{
				session.DoWork();
				if (count == 0)
				{
					WorkWithReentry(session, count + 1);
				}
			}
		}
예제 #4
0
		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);
				}
			}
		}
예제 #5
0
		public void SetUp()
		{
			_sentry = null;
		}