anchor.diff:  
   -record(queue, {oid, tid, op, pid, lucky}).
   
  -%% mnesia_held_locks: contain       {{Oid,Tid}, Op} entries
  --define(match_oid_held_locks(Oid),  {{Oid, '_'}, '_'}).
  +%% mnesia_held_locks: contain       {Oid, MaxLock, [{Op, 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, '_', '_'}).
   %% mnesia_sticky_locks: contain     {Oid, Node} entries and {Tab, Node} entries (set)
  
positive.code: 
  get_held_locks() ->
      ?MODULE ! {get_table, self(), mnesia_held_locks},
      Locks = receive {mnesia_held_locks, Ls} -> Ls  end,
      [{Oid, Op, Tid} || {{Oid, Tid}, Op} <- Locks].
  
  get_lock_queue() ->
      ?MODULE ! {get_table, self(), mnesia_lock_queue},
      Q = receive {mnesia_lock_queue, Locks} -> Locks  end,
      [{Oid, Op, Pid, Tid, WFT} || {queue, Oid, Tid, Op, Pid, WFT} <- Q].
  
  do_stop() ->
  
negative.code: check_lock(Tid, Oid, [], TabLocks, X, AlreadyQ, Type) ->
      check_lock(Tid, Oid, TabLocks, [], X, AlreadyQ, Type).
  
  can_queue([{_Op, Tid}|Locks], Tid, Oid, Res) ->
      can_queue(Locks, Tid, Oid, Res);
  can_queue([{Op, WaitForTid}|Locks], Tid, Oid = {Tab, _}, _) ->
      case allowed_to_be_queued(WaitForTid,Tid) of
  	true when Tid#tid.pid == WaitForTid#tid.pid ->
  	    dbg_out("Spurious lock conflict ~w ~w: ~w -> ~w~n",
  		    [Oid, Op, Tid, WaitForTid]),
  	    HaveQ = (ets:lookup(mnesia_lock_queue, Oid) /= [])
  		orelse (ets:lookup(mnesia_lock_queue,{Tab,?ALL}) /= []),
  	    case HaveQ of
  		true -> {no, WaitForTid};
  		false ->  can_queue(Locks, Tid, Oid, {queue, WaitForTid})
  	    end;
  	true ->
  	    can_queue(Locks, Tid, Oid, {queue, WaitForTid});
  	false ->
  	    {no, WaitForTid}
      end;
  can_queue([], _, _, Res) -> Res.
  
  %% True if  WaitForTid > Tid -> % Important order
  allowed_to_be_queued(WaitForTid, Tid) ->
      case get(pid_sort_order) of
  