Thread.yield();
} catch (InterruptedException x) {  } }
  boolean runShutdownHooks()  {    boolean first = false;    synchronized (libpath) // Synch on libpath, not this, to avoid deadlock.      {        if (exitSequence == null)          {            first = true;            exitSequence = Thread.currentThread();            if (shutdownHooks != null)              {                Iterator i = shutdownHooks.iterator();                while (i.hasNext()) // Start all shutdown hooks.                  try                    {                      ((Thread) i.next()).start();                    }                  catch (IllegalThreadStateException e)                    {                      i.remove();                    }              }			}		}    if (first)      {        if (shutdownHooks != null)          {            // Check progress of all shutdown hooks. As a hook completes,            // remove it from the set. If a hook calls exit, it removes            // itself from the set, then waits indefinitely on the            // exitSequence thread. Once the set is empty, set it to null to            // signal all finalizer threads that halt may be called.            while (! shutdownHooks.isEmpty())              {                Thread[] hooks;                synchronized (libpath)                  {                    hooks = new Thread[shutdownHooks.size()];                    shutdownHooks.toArray(hooks);                  }                for (int i = hooks.length; --i >= 0; )                  if (! hooks[i].isAlive())                    synchronized (libpath)                      {                        shutdownHooks.remove(hooks[i]);                      }                    Thread.yield(); // Give other threads a chance.              }            synchronized (libpath)              {                shutdownHooks = null;              }          }	// Run finalization on all finalizable objects (even if they are	// still reachable).        VMRuntime.runFinalizationForExit();      }    return first;	}