Example #1
0
    public void notify(Object... args) {
      int totalLocks = lockOperations + ThinLock.fastLocks + ThinLock.slowLocks;

      RVMThread.dumpStats();
      VM.sysWrite(" notifyAll operations\n");
      VM.sysWrite("FatLocks: ");
      VM.sysWrite(lockOperations);
      VM.sysWrite(" locks");
      Services.percentage(lockOperations, totalLocks, "all lock operations");
      VM.sysWrite("FatLocks: ");
      VM.sysWrite(unlockOperations);
      VM.sysWrite(" unlock operations\n");
      VM.sysWrite("FatLocks: ");
      VM.sysWrite(deflations);
      VM.sysWrite(" deflations\n");

      ThinLock.notifyExit(totalLocks);
      VM.sysWriteln();

      VM.sysWrite("lock availability stats: ");
      VM.sysWriteInt(globalLocksAllocated);
      VM.sysWrite(" locks allocated, ");
      VM.sysWriteInt(globalLocksFreed);
      VM.sysWrite(" locks freed, ");
      VM.sysWriteInt(globalFreeLocks);
      VM.sysWrite(" free locks\n");
    }
Example #2
0
 /**
  * Add a lock to the lock table
  *
  * @param l The lock object
  */
 @Uninterruptible
 public static void addLock(Lock l) {
   Lock[] chunk = locks[l.index >> LOG_LOCK_CHUNK_SIZE];
   int index = l.index & LOCK_CHUNK_MASK;
   Services.setArrayUninterruptible(chunk, index, l);
 }