public override void ValidateEntryInvariants() { try { using var lck = FlagVault.SpinLock(TimeSpan.FromSeconds(2)); if (lck.ShutdownCommandStatus?.StatusCode != CommandRequestStatusCode.Nil) { //bug 61 fix -- uncommented next line now rightly causes compilation error. //lck.Dispose(); lck.ForceClearPowerDownStatus(); } } catch (EntryInvariantsNotMetException) { throw; } catch (TimeoutException) { OnTimedOutGettingStatusLock(); } catch (Exception e) { OnUnexpectedExceptionThrown(e); } }
public override void ValidateEntryInvariants() { using var lck = FlagVault.SpinLock(TimeSpan.FromSeconds(2)); if (lck.IsEmpty) { throw new EntryInvariantsNotMetException(LaundryMachineStateCode.Full, "To be full, the laundry machine needs to have laundry in it."); } }