Skip to content
Snippets Groups Projects
Commit f2eef8f0 authored by Thomas Lopatic's avatar Thomas Lopatic
Browse files

Removed bad idea, which would have introduced a race condition.

parent b7899407
No related branches found
No related tags found
No related merge requests found
......@@ -40,9 +40,6 @@ public class AcknowledgedCounterGenerator extends CounterGenerator
*/
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.");
}
......@@ -71,8 +68,5 @@ public class AcknowledgedCounterGenerator extends CounterGenerator
lock.unlock();
}
}
// write volatile variable to make other threads see changes
limit = limit;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment