public static int getId() {
    boolean done = false;
    int result = -1;
    for (;;) {
      synchronized (myPid) {
        done = reaperStarted;
        result = myPid[0];
      }
      if (done) {
        break;
      }

      // wait for reaper thread to initialize myPid
      try {
        Thread.sleep(100);
      } catch (InterruptedException ignore) {
        Thread.currentThread().interrupt();
      }
    }
    return result;
  }
Get the vm's process id. On Linux, this returns the processId of the reaper thread.

@return the vm's process id.
geode-logging/src/main/java/org/apache/geode/logging/internal/OSProcess.java