mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Add Jvm.nanoPause to tight loops
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package net.openhft.chronicle.hash.replication;
|
||||
|
||||
import net.openhft.chronicle.core.Jvm;
|
||||
import net.openhft.chronicle.hash.ChronicleHash;
|
||||
import net.openhft.chronicle.hash.ChronicleHashBuilderPrivateAPI;
|
||||
|
||||
@@ -61,6 +62,7 @@ public final class TimeProvider {
|
||||
return lastTime;
|
||||
if (lastTimeHolder.compareAndSet(lastTime, now))
|
||||
return now;
|
||||
Jvm.nanoPause();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user