anchor.diff:                    file:delete(dets_table),
                     Parent = self(),
                     {ok, _T} = dets:open_file(dets_table,[{type,bag}]),
  -                  sched:rep_yield(),
  +                  sched:yield(),
                     spawn(fun() ->
                                   dets:open_file(dets_table,[{type,bag}]),
  -                                sched:rep_yield(),
  +                                sched:yield(),
                                   Parent ! done
                           end),
                     spawn(fun() ->
                                   dets:insert(dets_table,[{0,0}]),
  -                                sched:rep_yield(),
  +                                sched:yield(),
                                   ?assertEqual([{0,0}], get_contents(dets_table)),
                                   Parent ! done
                           end),
  
positive.code: 
  bug6() ->
      dets:open_file(dets_table,[{type,bag}]),
      sched:rep_yield(),
      dets:close(dets_table),
      sched:rep_yield(),
      dets:open_file(dets_table,[{type,bag}]),
      sched:rep_yield(),
      spawn(fun() -> dets:lookup(dets_table,0),
                     sched:rep_yield()
            end),
      spawn(fun() -> dets:insert(dets_table,{0,0}),
                     sched:rep_yield()
            end),
      dets:insert(dets_table,{0,0}),
      sched:rep_yield(),
      ?assertEqual([{0,0}], match_object(dets_table)).
  
  get_contents(Name) ->
      Ret = dets:traverse(Name, fun(X)-> {continue,X} end),
      sched:rep_yield(),
      Ret.
  
  match_object(Name) ->
      Ret = dets:match_object(Name,'_'),
      sched:rep_yield(),
      Ret.
  
negative.code: 
  -export([bug3/0, bug5/0, bug6/0]).
  
  -include_lib("eunit/include/eunit.hrl").
  
  %% should always print [{0,0}], but sometimes prints []
  bug3() ->
      dets:close(dets_table),
      sched:yield(),
      file:delete(dets_table),
      sched:yield(),
      dets:open_file(dets_table,[{type,bag}]),
      sched:yield(),
      spawn(fun() -> dets:open_file(dets_table,[{type,bag}]),
                     sched:yield()
            end),
      spawn(fun() ->
                    dets:insert(dets_table,[{0,0}]),
                    sched:yield(),
                    ?assertEqual([{0,0}], get_contents(dets_table))
            end).
  
  