public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { }
public UID() { time = System.currentTimeMillis(); unique = machineId; if (time > last) { last = time; count = uidCounter = Short.MIN_VALUE; } else { synchronized (UID.class) { if (uidCounter == Short.MAX_VALUE) {   try { Thread.sleep(2); } catch (InterruptedException e) { } uidCounter = Short.MIN_VALUE; time = last = System.currentTimeMillis(); }  count = uidCounter++;
public UID() {	synchronized (lock) {		if (nextCount == Short.MAX_VALUE) {			long newtime;			for (;;) {				newtime = System.currentTimeMillis();				if (newtime - baseTime > 1000) {					break;				}				try {					Thread.sleep(1000);				}				catch (InterruptedException _) {				}			}			baseTime = newtime;			nextCount = Short.MIN_VALUE;		}		count = nextCount++;		unique = uniqueNr;		time = baseTime;	}}