Skip to content

Commit

Permalink
8289147: unify os::infinite_sleep on posix platforms
Browse files Browse the repository at this point in the history
Backport-of: 62e1e7950b37deaede3573a4b37542199552aea3
  • Loading branch information
MBaesken committed Jul 15, 2022
1 parent 528693c commit a087c51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
7 changes: 0 additions & 7 deletions src/hotspot/os/aix/os_aix.cpp
Expand Up @@ -2209,13 +2209,6 @@ char* os::pd_attempt_reserve_memory_at(char* requested_addr, size_t bytes, bool
return addr;
}

// Sleep forever; naked call to OS-specific sleep; use with CAUTION
void os::infinite_sleep() {
while (true) { // sleep forever ...
::sleep(100); // ... 100 seconds at a time
}
}

// Used to convert frequent JVM_Yield() to nops
bool os::dont_yield() {
return DontYieldALot;
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/os/bsd/os_bsd.cpp
Expand Up @@ -1874,13 +1874,6 @@ char* os::pd_attempt_reserve_memory_at(char* requested_addr, size_t bytes, bool
return NULL;
}

// Sleep forever; naked call to OS-specific sleep; use with CAUTION
void os::infinite_sleep() {
while (true) { // sleep forever ...
::sleep(100); // ... 100 seconds at a time
}
}

// Used to convert frequent JVM_Yield() to nops
bool os::dont_yield() {
return DontYieldALot;
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/os/linux/os_linux.cpp
Expand Up @@ -4251,13 +4251,6 @@ char* os::pd_attempt_reserve_memory_at(char* requested_addr, size_t bytes, bool
return NULL;
}

// Sleep forever; naked call to OS-specific sleep; use with CAUTION
void os::infinite_sleep() {
while (true) { // sleep forever ...
::sleep(100); // ... 100 seconds at a time
}
}

// Used to convert frequent JVM_Yield() to nops
bool os::dont_yield() {
return DontYieldALot;
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/os/posix/os_posix.cpp
Expand Up @@ -790,6 +790,12 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name,
return agent_entry_name;
}

// Sleep forever; naked call to OS-specific sleep; use with CAUTION
void os::infinite_sleep() {
while (true) { // sleep forever ...
::sleep(100); // ... 100 seconds at a time
}
}

void os::naked_short_nanosleep(jlong ns) {
struct timespec req;
Expand Down

1 comment on commit a087c51

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.