* different clock sequences for each thread.
*/
public class ConcurrentTimeUuidState implements TimeUuidState {
+// public final static ThreadLocal<Boolean> isTimeUuidThread = new ThreadLocal<>() {
+//
+// @Override
+// protected Boolean initialValue() {
+// return false;
+// }
+// };
+
/** The maximum possible value of the clocksequence. */
private final static int MAX_CLOCKSEQUENCE = 16384;
Holder value = new Holder();
value.lastTimestamp = startTimeStamp;
value.clockSequence = newClockSequence();
+// isTimeUuidThread.set(true);
return value;
}
};
*/
public long useTimestamp() {
+
long previousTimestamp = holder.get().lastTimestamp;
long now = computeNow();