anchor.diff:  code_change(_OldVsn, State, _Extra) ->
       {ok, State}.
   
  -terminate(deactivated, _State) ->
  +terminate({shutdown, deactivated}, _State) ->
       ok;
   terminate(?NO_PROVIDER_ERROR, #state{cb_module=CbModule,
                                        id=Id}) ->
  
positive.code:     case CbModule:deactivate(CbState) of
          {save, NewCbState} ->
              NewETag = replace_state(CbModule, Provider, Id, NewCbState, ETag),
              {stop, deactivated, State#state{cb_state=NewCbState,
                                              etag=NewETag}};
          {ok, NewCbState} ->
              {stop, deactivated, State#state{cb_state=NewCbState}}
      end.
  
  handle_reply(Reply, State=#state{ref=GrainRef}) ->
  
negative.code:         end
      catch
          %% Retry only if the process deactivated
          exit:{Reason, _} when Reason =:= {shutdown, deactivated}
                              ; Reason =:= normal ->
              do_for_ref(GrainRef, Fun)
      end.
  
  