anchor.diff:  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.RemoveTransition(const FromState : TState;
     const OnCommand : TCommand) : IFiniteStateMachine;
   begin
  -  Lock;
  +  InternalLock;
     try
       FFiniteStateMachine.RemoveTransition(FromState, OnCommand);
     finally
  -    Unlock;
  +    InternalUnlock;
     end;
   
     Result := Self;
  
positive.code: function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.AddTransition(const FromState, ToState : TState;
    const OnCommand : TCommand; const OnEnter : TOnEnterStateProc; const OnExit : TOnExitStateProc) : IFiniteStateMachine;
  begin
    Lock;
    try
      FFiniteStateMachine.AddTransition(FromState, ToState, OnCommand, OnEnter, OnExit);
    finally
      Unlock;
    end;
  
    Result := Self;
  
negative.code: 
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.GetCurrentState : TState;
  begin
    InternalLock;
    try
      Result := FFiniteStateMachine.CurrentState;
    finally
      InternalUnlock;
    end;
  end;
  
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.GetPreviousState : TState;
  begin
    InternalLock;
    try
      Result := FFiniteStateMachine.PreviousState;
    finally
      InternalUnlock;
    end;
  end;
  
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.GetReachableState(const FromState : TState;
    const OnCommand : TCommand) : TState;
  begin
    InternalLock;
    try
      Result := FFiniteStateMachine.GetReachableState(FromState, OnCommand);
    finally
      InternalUnlock;
    end;
  end;
  
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.GetReachableState(const OnCommand : TCommand) : TState;
  begin
    InternalLock;
    try
      Result := FFiniteStateMachine.GetReachableState(OnCommand);
    finally
      InternalUnlock;
    end;
  end;
  
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.HasTransition(const OnCommand : TCommand) : Boolean;
  begin
    InternalLock;
    try
      Result := FFiniteStateMachine.HasTransition(OnCommand);
    finally
      InternalUnlock;
    end;
  end;
  
  procedure TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.InternalLock;
  begin
    TMonitor.Enter(FLock);
  end;
  
  procedure TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.InternalUnlock;
  begin
    TMonitor.Exit(FLock);
  end;
  
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.Lock : IFiniteStateMachine;
  begin
    InternalLock;
    Result := FFiniteStateMachine;
  end;
  
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.HasTransition(const FromState : TState;
    const OnCommand : TCommand) : Boolean;
  begin
    InternalLock;
    try
      Result := FFiniteStateMachine.HasTransition(FromState, OnCommand);
    finally
      InternalUnlock;
    end;
  end;
  
  function TThreadFiniteStateMachine<TState, TCommand, ErrorClass>.RemoveAllTransitions : IFiniteStateMachine;
  begin
    InternalLock;
    try
      FFiniteStateMachine.RemoveAllTransitions;
    finally
      InternalUnlock;
    end;
  
    Result := Self;
  