os::pause()
-
//Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) void os::pause() { char filename[MAX_PATH]; if (PauseAtStartupFile && PauseAtStartupFile[0]) { jio_snprintf(filename, MAX_PATH, PauseAtStartupFile); } else { jio_snprintf(filename, MAX_PATH, "./vm.paused.%d", current_process_id()); } int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd != -1) { struct stat buf; ::close(fd); while (::stat(filename, &buf) == 0) { (void)::poll(NULL, 0, 100); } } else { jio_fprintf(stderr, "Could not open pause file '%s', continuing immediately.\n", filename); } }