while (true) { try {  return sfResolveHere(name); } catch (SmartFrogResolutionException ex) {  long now = (new Date()).getTime();  if (now >= endTime) { throw ex; }  wait(endTime - now); } }
synchronized (processLocks) { while (true) { try {   if (processLocks.contains(name)) { throw SmartFrogResolutionException.notFound(new Reference(name), sfCompleteNameSafe()); } else return sfResolveHere(name); } catch (SmartFrogResolutionException ex) {  long now = (new Date()).getTime();  if (now >= endTime) { throw ex; } processLocks.add(name); processLocks.wait(endTime - now); } } }
    public synchronized Object sfResolveHereOrWait(Object name, long timeout)        throws Exception {        long endTime = (new Date()).getTime() + timeout;        while (true) {            try {                // try to return the attribute value                return sfResolveHere(name);            } catch (SmartFrogResolutionException ex) {                // not found, wait for leftover timeout                long now = (new Date()).getTime();                if (now >= endTime) {                    throw ex;                }                wait(endTime - now);            }        }    }