anchor.diff:  can_lock(Tid, read, {Tab, Key}, AlreadyQ) when Key /= ?ALL ->
       %% The key is bound, no need for the other BIF
       Oid = {Tab, Key},
  -    ObjLocks = ?ets_match_object(mnesia_held_locks, {Oid, write, '_'}),
  -    TabLocks = ?ets_match_object(mnesia_held_locks, {{Tab, ?ALL}, write, '_'}),
  +    ObjLocks = ?ets_match_object(mnesia_held_locks, {{Oid, '_'}, write}),
  +    TabLocks = ?ets_match_object(mnesia_held_locks, {{{Tab, ?ALL}, '_'}, write}),
       check_lock(Tid, Oid, ObjLocks, TabLocks, yes, AlreadyQ, read);
   
   can_lock(Tid, read, Oid, AlreadyQ) -> % Whole tab
       Tab = element(1, Oid),
  -    ObjLocks = ?ets_match_object(mnesia_held_locks, {{Tab, '_'}, write, '_'}),
  +    ObjLocks = ?ets_match_object(mnesia_held_locks, {{{Tab, '_'}, '_'}, write}),
       check_lock(Tid, Oid, ObjLocks, [], yes, AlreadyQ, read);
   
   can_lock(Tid, write, {Tab, Key}, AlreadyQ) when Key /= ?ALL ->
       Oid = {Tab, Key},
  -    ObjLocks = ?ets_lookup(mnesia_held_locks, Oid),
  -    TabLocks = ?ets_lookup(mnesia_held_locks, {Tab, ?ALL}),
  +    ObjLocks = ?ets_match_object(mnesia_held_locks, ?match_oid_held_locks(Oid)),
  +    TabLocks = ?ets_match_object(mnesia_held_locks, ?match_oid_held_locks({Tab, ?ALL})),
       check_lock(Tid, Oid, ObjLocks, TabLocks, yes, AlreadyQ, write);
   
   can_lock(Tid, write, Oid, AlreadyQ) -> % Whole tab
  
positive.code: init(Parent) ->
      register(?MODULE, self()),
      process_flag(trap_exit, true),
      ?ets_new_table(mnesia_held_locks, [bag, private, named_table]),
      ?ets_new_table(mnesia_tid_locks, [bag, private, named_table]),
      ?ets_new_table(mnesia_sticky_locks, [set, private, named_table]),
      ?ets_new_table(mnesia_lock_queue, [bag, private, named_table, {keypos, 2}]),
  
negative.code: release_lock({Tid, Oid, Op}) ->
      if
  	Op == write ->
  	    ?ets_delete(mnesia_held_locks, {Oid, Tid});
  	Op == read ->
  	    ets:delete_object(mnesia_held_locks, {{Oid, Tid}, Op})
      end.
  
  rearrange_queue([{_Tid, {Tab, Key}, _} | Locks]) ->
  