anchor.diff:      end.
   
   -compile({inline, [rtm_entry_new/4, get_rtmkey/1, set_rtmkey/2, get_rtmpid/1,
  -                   get_nth/1, get_accpid/1,
  -                   rtms_get_rtmpids/1, rtms_get_accpids/1]}).
  +                   get_nth/1, %get_accpid/1,
  +                   rtms_get_valid_rtmpids/1, rtms_get_valid_accpids/1]}).
   
   -spec rtm_entry_new(?RT:key(), {comm:mypid()} | unknown,
                       0..3, {comm:mypid()} | unknown) -> rtm().
  
positive.code: get_rtmpid(RTMEntry) -> element(2, RTMEntry).
  -spec get_nth(rtm()) -> 0..3.
  get_nth(RTMEntry)    -> element(3, RTMEntry).
  -spec get_accpid(rtm()) -> {comm:mypid()} | unknown.
  get_accpid(RTMEntry) -> element(4, RTMEntry).
  
  -spec rtms_get_rtmpids(rtms()) -> [ {comm:mypid()} | unknown ].
  rtms_get_rtmpids(RTMs) -> [ get_rtmpid(X) || X <- RTMs ].
  -spec rtms_get_accpids(rtms()) -> [ {comm:mypid()} | unknown ].
  rtms_get_accpids(RTMs) -> [ get_accpid(X) || X <- RTMs ].
  
  -spec rtms_upd_entry(rtms(), ?RT:key(), comm:mypid(), comm:mypid()) -> rtms().
  rtms_upd_entry(RTMs, InKey, InPid, InAccPid) ->
      [ case InKey =:= get_rtmkey(Entry) of
            true ->
                RTM = get_rtmpid(Entry),
                case {InPid} =/= RTM of
                    true -> case RTM of
                                unknown -> ok;
                                _ ->
                                    fd:unsubscribe_refcount(element(1, RTM), tx_tm_rtm_fd_cookie)
                            end,
                            fd:subscribe_refcount(InPid, tx_tm_rtm_fd_cookie);
                    false -> ok
                end,
                rtm_entry_new(InKey, {InPid}, get_nth(Entry), {InAccPid});
            false -> Entry
        end || Entry <- RTMs ].
  
  -spec send_to_rtms(rtms(), fun((rtm()) -> comm:message())) -> ok.
  
negative.code:     %% be used
      Tid = tx_state_get_tid(TxState),
      RTMs = tx_state_get_rtms(TxState),
      CleanRTMs = rtms_get_valid_rtmpids(RTMs),
      Accs = rtms_get_valid_accpids(RTMs),
      TM = comm:this(),
      _ = [ begin
            %% ItemState = lists:keyfind(ItemId, 1, ItemStates),
  