Skip to content

Commit

Permalink
Merge branch 'nanotime-lock' of https://github.com/ash2k/astyanax int…
Browse files Browse the repository at this point in the history
…o ash2k-nanotime-lock
  • Loading branch information
sagarl committed Feb 13, 2014
2 parents a20aab8 + 5afcbce commit e51608b
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -248,7 +248,7 @@ public void acquire() throws Exception {
m.execute();

verifyLock(curTimeMicros);
acquireTime = System.currentTimeMillis();
acquireTime = System.nanoTime();
return;
}
catch (BusyLockException e) {
Expand Down Expand Up @@ -325,7 +325,7 @@ public void releaseWithMutation(MutationBatch m) throws Exception {
}

public boolean releaseWithMutation(MutationBatch m, boolean force) throws Exception {
long elapsed = System.currentTimeMillis() - acquireTime;
long elapsed = TimeUnit.MILLISECONDS.convert(System.nanoTime() - acquireTime, TimeUnit.NANOSECONDS);
boolean isStale = false;
if (timeout > 0 && elapsed > TimeUnit.MILLISECONDS.convert(timeout, this.timeoutUnits)) {
isStale = true;
Expand Down

0 comments on commit e51608b

Please sign in to comment.