1. 06 6月, 2015 2 次提交
  2. 15 5月, 2015 1 次提交
    • M
      lockfile: allow file locking to be retried with a timeout · 044b6a9e
      Michael Haggerty 提交于
      Currently, there is only one attempt to lock a file. If it fails, the
      whole operation fails.
      
      But it might sometimes be advantageous to try acquiring a file lock a
      few times before giving up. So add a new function,
      hold_lock_file_for_update_timeout(), that allows a timeout to be
      specified. Make hold_lock_file_for_update() a thin wrapper around the
      new function.
      
      If timeout_ms is positive, then retry for at least that many
      milliseconds to acquire the lock. On each failed attempt, use select()
      to wait for a backoff time that increases quadratically (capped at 1
      second) and has a random component to prevent two processes from
      getting synchronized. If timeout_ms is negative, retry indefinitely.
      
      In a moment we will switch to using the new function when locking
      packed-refs.
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      044b6a9e
  3. 04 11月, 2014 1 次提交
  4. 16 10月, 2014 1 次提交
  5. 02 10月, 2014 31 次提交
  6. 29 8月, 2014 1 次提交
  7. 15 7月, 2014 3 次提交