VM.sysWriteln("WAITED LONG TIME FOR PRECEEDING GC TO FINISH"); VM.sysWriteln("          len = ", len); VM.sysWriteln("    maxCollTh = ", maxCollectorThreads);
VM.sysWriteln("GCWarning: WAITED LONG TIME FOR PRECEEDING GC TO FINISH"); VM.sysWriteln("GCWarning:          len = ", len); VM.sysWriteln("GCWarning:    maxCollTh = ", maxCollectorThreads);
  private int waitForPrecedingGC() throws VM_PragmaUninterruptible {    /*     * Get the number of GC threads.  Include NativeDaemonProcessor     * collector thread in the count.  If it exists, check for null to     * allow builds without a NativeDaemon (see VM_Scheduler)     */    int maxCollectorThreads = VM_Scheduler.numProcessors;    if (!VM.BuildForSingleVirtualProcessor && 	VM_Scheduler.processors[VM_Scheduler.nativeDPndx] != null )      maxCollectorThreads++;        /* Wait for all gc threads to finish preceeding collection cycle */    if (verbose >= 1) {	VM.sysWrite("GC Message: VM_Handshake.initiateCollection ");	VM.sysWriteln("checking if previous collection is finished");    }    int count = 0;    while (true) {      VM_Scheduler.collectorMutex.lock();      int len = VM_Scheduler.collectorQueue.length();      if (count++ == 100000) {	VM.sysWriteln("WAITED LONG TIME FOR PRECEEDING GC TO FINISH");	VM.sysWriteln("          len = ", len);	VM.sysWriteln("    maxCollTh = ", maxCollectorThreads);	VM_Scheduler.collectorQueue.dump();      }      VM_Scheduler.collectorMutex.unlock();      if (len < maxCollectorThreads) {	if (verbose >= 1) VM.sysWrite("GC Message: VM_Handshake.initiateCollection waiting for previous collection to finish");	lock.release();   // release lock so other threads can make progress	VM_Thread.getCurrentThread().yield();	lock.acquire();   // acquire lock to make progress      } else 	break;    }    return maxCollectorThreads;  }