anchor.diff:  %%--------------------------------------------------------------------
   %%% Internal functions
   %%--------------------------------------------------------------------
  -pass_token(S) ->
  +pass_token(Tag, S) ->
       demonitor_process(S),
       case queue:out(S#state.pids) of
   	{{value, Pid}, Q2} ->
   	    etorrent_t_control:token(Pid),
   	    Ref = erlang:monitor(process, Pid),
  -	    {reply, ok, running, S#state{ pids = Q2,
  -					  monitored = Ref}};
  +	    NS = S#state{pids = Q2,
  +			 monitored = Ref},
  +	    case Tag of
  +		reply ->
  +		    {reply, ok, running, NS};
  +		next_state ->
  +		    {next_state, running, NS}
  +	    end;
   	{empty, Q} ->
  -	    {reply, ok, dormant, S#state{ pids = Q,
  -					  monitored = none}}
  +	    NS = S#state{ pids = Q, monitored = none},
  +	    case Tag of
  +		reply ->
  +		    {reply, ok, running, NS};
  +		next_state ->
  +		    {next_state, running, NS}
  +	    end
       end.
   
   demonitor_process(S) when S#state.monitored == none ->
  
positive.code: running(request_token, {From, _Tag}, S) ->
      {reply, wait, running, S#state{pids = queue:in(From, S#state.pids)}};
  running(release_token, _From, S) ->
      pass_token(S).
  
  
  %%--------------------------------------------------------------------
  
negative.code: %% (or a system message).
  %%--------------------------------------------------------------------
  handle_info({'DOWN', _Ref, process, _Pid, _Reason}, running, S) ->
      pass_token(next_state, S);
  handle_info(_Info, StateName, State) ->
      {next_state, StateName, State}.
  
  