Example #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public BusyGuard
        (
            [NotNull] BusyState state
        )
        {
            Sure.NotNull(state, "state");

            _state   = state;
            _timeout = TimeSpan.Zero;

            _Grab();
        }
Example #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public BusyGuard
        (
            [NotNull] BusyState state,
            TimeSpan timeout
        )
        {
            Sure.NotNull(state, nameof(state));

            _state   = state;
            _timeout = timeout;

            _Grab();
        }