public void ChangeState(ServiceLauncherState state) { Interlocked.Exchange(ref internalState, (int)state); }
public bool HasState(ServiceLauncherState state) { return((ServiceLauncherState)Interlocked.CompareExchange(ref internalState, (int)state, (int)state) == state); }
public bool TryChangeState(ServiceLauncherState fromState, ServiceLauncherState toState) { return(Interlocked.CompareExchange(ref internalState, (int)toState, (int)fromState) == (int)fromState); }