Skip to content

Commit

Permalink
Removed bad idea, which would have introduced a race condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
uncle-betty committed Sep 21, 2015
1 parent 09dadfc commit 18d41ce
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ public int lastInt()
*/
public void acknowledge(int value)
{
// read volatile variable to see other threads' changes
limit = limit;

if (value > limit + WINDOW_SIZE) {
throw new RuntimeException("Too many unacknowledged insertion keys.");
}
Expand Down Expand Up @@ -71,8 +68,5 @@ public void acknowledge(int value)
lock.unlock();
}
}

// write volatile variable to make other threads see changes
limit = limit;
}
}

0 comments on commit 18d41ce

Please sign in to comment.