nYields++; if (nYields >= yieldThreshold) { synchronized(this) {   if (nYields >= yieldThreshold) { passivate(); notifyOrganizer(); totalYields += nYields; nYields = 0; } } }
int yp = VM_Synchronization.fetchAndAdd(this, VM_Entrypoints.yieldCountListenerNumYieldsField.getOffset(), 1) + 1; if (yp == yieldThreshold) { totalYields += yp; numYields = 0; activateOrganizer(); }
  public void update(int whereFrom) {     nYields++;     if (nYields >= yieldThreshold) {	synchronized(this) {	  // now that we're in a critical section, double-check that	  // another thread has not yet processed this threshold reached event.     	  if (nYields >= yieldThreshold) {	    passivate();            notifyOrganizer();            totalYields += nYields;            nYields = 0;	  }        }     }  }