anchor.diff:  
   -record(queue, {oid, tid, op, pid, lucky}).
   
  -%% mnesia_held_locks: contain       {Oid, MaxLock, [{Op, Tid}]} entries
  --define(match_oid_held_locks(Oid),  {Oid, '_', '_'}).
  +%% mnesia_held_locks: contain       {{Oid, Lock, Tid}} entries
  +-define(match_oid_held_locks(Oid),  {{Oid, '_', '_'}}).
   %% mnesia_tid_locks: contain        {Tid, Oid, Op} entries  (bag)
  --define(match_oid_tid_locks(Tid),   {Tid, '_', '_'}).
  +-define(match_oid_tid_locks(Tid),   {{Tid, '_', '_'}}).
   %% mnesia_sticky_locks: contain     {Oid, Node} entries and {Tab, Node} entries (set)
   -define(match_oid_sticky_locks(Oid),{Oid, '_'}).
   %% mnesia_lock_queue: contain       {queue, Oid, Tid, Op, ReplyTo, WaitForTid} entries (bag)
  
positive.code: 		    {not_granted, C}
  	    end
      end;
  grant_lock(Tid, {ix_read,IxKey,Pos}, Lock, Oid = {Tab, _}, Default) ->
      try
  	Res = ix_read_res(Tab, IxKey,Pos),
  	set_lock(Tid, Oid, Lock, Default),
  	{granted, Res, [?ALL]}
      catch _:_ ->
  	    {not_granted, {no_exists, Tab, {index, [Pos]}}}
      end;
  grant_lock(Tid, read, Lock, Oid, Default) ->
      set_lock(Tid, Oid, Lock, Default),
      {granted, ok};
  grant_lock(Tid, write, Lock, Oid, Default) ->
      set_lock(Tid, Oid, Lock, Default),
      granted.
  
  %% 1) Impose an ordering on all transactions favour old (low tid) transactions
  
negative.code:     Op = {ix_read,IxKey, Pos},
      Lock = read,
      case can_lock(Tid, Lock, Oid, {no, bad_luck}) of
  	yes ->
  	    Reply = grant_lock(Tid, Op, Lock, Oid),
  	    reply(From, Reply);
  	{no, Lucky} ->
  	    C = #cyclic{op = Op, lock = Lock, oid = Oid, lucky = Lucky},
  	    ?dbg("Rejected ~p ~p ~p ~p ~n", [Tid, Oid, Lock, Lucky]),
  	    reply(From, {not_granted, C});
  	{queue, Lucky} ->
  	    ?dbg("Queued ~p ~p ~p ~p ~n", [Tid, Oid, Lock, Lucky]),
  	    %% Append to queue: Nice place for trace output
  	    ?ets_insert(mnesia_lock_queue,
  