/* Dequeue and schedule collector threads on ALL RVM Processors,
/* Deque and schedule collector threads on ALL RVM Processors,
  private void initiateCollection() throws VM_PragmaUninterruptible {    /* check that scheduler initialization is complete */    if (!VM_Scheduler.allProcessorsInitialized) {      VM.sysWrite("GC required before system fully initialized");      VM.sysWriteln("Specify larger than default heapsize on command line");      VM_Scheduler.dumpStack();      VM.shutdown(VM.exitStatusMiscTrouble);    }    /* wait for preceding GC to complete */    if (verbose >= 2) {      VM.sysWrite("GC Message: VM_Handshake.initiateCollection before waiting");      VM_Scheduler.collectorQueue.dump();    }    int maxCollectorThreads = waitForPrecedingGC();    /* Acquire global lockout field inside the boot record.  Will be     * released when gc completes. */    if (verbose >= 1) VM.sysWriteln("GC Message: VM_Handshake.initiateCollection acquiring lockout field");    acquireLockoutLock(LOCKOUT_GC_WORD, true);    if (verbose >= 1) VM.sysWriteln("GC Message: VM_Handshake.initiateCollection acquired lockout field");    /* reset counter for collector threads arriving to participate in     * the collection */    VM_CollectorThread.participantCount[0] = 0;        /* reset rendezvous counters to 0, the decision about which     * collector threads will participate has moved to the run method     * of CollectorThread */    VM_CollectorThread.gcBarrier.resetRendezvous();    /* scan all the native Virtual Processors and attempt to block     * those executing native C, to prevent returning to java during     * collection.  the first collector thread will wait for those not     * blocked to reach the SIGWAIT state.  (see     * VM_CollectorThread.run) */    for (int i = 1; i <= VM_Processor.numberNativeProcessors; i++) {      if (VM.VerifyAssertions)	VM._assert(VM_Processor.nativeProcessors[i] != null);      VM_Processor.nativeProcessors[i].lockInCIfInC();      if (verbose >= 1) {        int newStatus =  VM_Processor.nativeProcessors[i].vpStatus;        VM.sysWriteln("GC Message: VM_Handshake.initiateCollection:  Native Processor ", i, " newStatus = ", newStatus);      }    }    /* Dequeue and schedule collector threads on ALL RVM Processors,     * including those running system daemon threads     * (ex. NativeDaemonProcessor) */    if (verbose >= 1)       VM.sysWriteln("GC Message: VM_Handshake.initiateCollection: scheduling collector threads");    VM_Scheduler.collectorMutex.lock();    if (VM_Scheduler.collectorQueue.length() != maxCollectorThreads)       VM.sysWriteln("GC Error: Expected ", maxCollectorThreads, 		    " GC threads.   Found ", 		    VM_Scheduler.collectorQueue.length());    while (VM_Scheduler.collectorQueue.length() > 0) {      VM_Thread t = VM_Scheduler.collectorQueue.dequeue();      t.scheduleHighPriority();      VM_Processor p = t.processorAffinity;      p.threadSwitchRequested = -1; // set thread switch req condition in VP    }    VM_Scheduler.collectorMutex.unlock();  }