anchor.diff:              Error
       end.
   
  --spec async_put_replies(ReqIds :: list({reference(), pid()}), riak_object:options()) ->
  +-spec async_put_replies(ReqIdTuples :: list({reference(), pid()}), riak_object:options()) ->
                                          list(term()).
  -async_put_replies(ReqIds, Options) ->
  -    Timeout = case proplists:get_value(timeout, Options, ?DEFAULT_TIMEOUT) of
  -                  N when is_integer(N) andalso N > 0 ->
  -                      N;
  -                  _ ->
  -                      ?DEFAULT_TIMEOUT
  -              end,
  -    async_put_reply_loop(ReqIds, [], Timeout).
  +async_put_replies(ReqIdTuples, Options) ->
  +    async_put_reply_loop(ReqIdTuples, [], os:timestamp(),
  +                         find_put_timeout(Options)).
   
   
   %%%===================================================================
  
positive.code: %%%% Functions to handle asynchronous puts
  
  %% Invoked by put/2 to turn the async request into a synchronous call
  synchronize_put({ok, {ReqId, Worker}}, Options) ->
      Timeout = case proplists:get_value(timeout, Options, ?DEFAULT_TIMEOUT) of
                    N when is_integer(N) andalso N > 0 ->
                        N;
                    _ ->
                        ?DEFAULT_TIMEOUT
                end,
      %% this is not direct gen_server:call because the process that
      %% replies is not the one that received the cast
      receive
          {'DOWN', ReqId, process, _Pid, _Reason} ->
              {error, riak_kv_w1c_server_crashed};
  
negative.code:             erlang:demonitor(ReqId, [flush]),
              Response
      after Timeout ->
              erlang:demonitor(ReqId, [flush]),
              gen_server:cast(Worker, {cancel, ReqId}),
              {error, timeout}
      end.
  
  non_neg(X) ->
      max(0, X).
  
  remaining_put_timeout(Start, Timeout) ->
      non_neg(Timeout -
                  non_neg(trunc(timer:now_diff(os:timestamp(), Start)))).
  
  find_put_timeout(Options) ->
      case proplists:get_value(timeout, Options, ?DEFAULT_TIMEOUT) of
          N when is_integer(N) andalso N > 0 ->
              N;
          _ ->
              ?DEFAULT_TIMEOUT
      end.
  