anchor.diff:  
   maybe_push_message(S=#state{props=Props, waiting=Waiting}) ->
       case queue:out(Waiting) of
  -        {{value, {From, ExpireAt, Ref}}, NewWaiting} ->
  +        {{value, W=#waiting{ref=Ref}}, NewWaiting} ->
               Timeout = proplists:get_value(timeout, Props),
  -            case ExpireAt > lmq_misc:unixtime() andalso
  +            case wait_valid(W) andalso
                       lmq_lib:dequeue(S#state.name, Timeout) of
                   false -> %% client timeout
                       maybe_push_message(S#state{waiting=NewWaiting});
  
positive.code: 
  -include("lmq.hrl").
  -record(state, {name, props, waiting=queue:new(), monitors=gb_sets:empty()}).
  
  start(Name) ->
      supervisor:start_child(lmq_queue_sup, [Name]).
  
negative.code:                 Msg ->
                      erlang:demonitor(Ref, [flush]),
                      Monitors = gb_sets:delete(Ref, S#state.monitors),
                      gen_server:reply(W#waiting.from, Msg),
                      S#state{waiting=NewWaiting, monitors=Monitors}
              end;
          {empty, Waiting} ->
              S
      end.
  
  wait_valid(#waiting{timeout=infinity}) ->
      true;
  wait_valid(#waiting{start_time=StartTime, timeout=Timeout}) ->
      StartTime + Timeout > lmq_misc:unixtime().
  
  get_timeout(S=#state{}) ->
      case queue:is_empty(S#state.waiting) of
  