本文整理了Java中net.openhft.chronicle.bytes.Bytes.readVolatileLong()
方法的一些代码示例,展示了Bytes.readVolatileLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.readVolatileLong()
方法的具体详情如下:
包路径:net.openhft.chronicle.bytes.Bytes
类名称:Bytes
方法名:readVolatileLong
暂无
代码示例来源:origin: peter-lawrey/Performance-Examples
public long getCount() {
return bytes.readVolatileLong(COUNTER_OFFSET);
}
}
代码示例来源:origin: net.openhft/chronicle-bytes
@Override
public long currentTimeMicros() {
long time = provider.currentTimeMicros();
while (true) {
long time0 = bytes.readVolatileLong(LAST_TIME);
if (time0 >= time)
time = time0 + 1;
if (bytes.compareAndSwapLong(LAST_TIME, time0, time))
return time;
}
}
代码示例来源:origin: net.openhft/chronicle-bytes
@Override
public long currentTimeNanos() {
long time = provider.currentTimeNanos();
long time2 = time / 1000;
while (true) {
long time0 = bytes.readVolatileLong(LAST_TIME);
if (time0 >= time2) {
time = time2 + 1;
time2 = time * 1000;
}
if (bytes.compareAndSwapLong(LAST_TIME, time0, time))
return time;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!