Skip to content

Commit

Permalink
8306965: osThread allocation failures should not abort the VM
Browse files Browse the repository at this point in the history
Reviewed-by: lfoltan
  • Loading branch information
David Holmes committed May 11, 2023
1 parent 4795c39 commit 3cb606e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/os/aix/os_aix.cpp
Expand Up @@ -743,7 +743,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
assert(thread->osthread() == nullptr, "caller responsible");

// Allocate the OSThread object.
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();
if (osthread == nullptr) {
return false;
}
Expand Down Expand Up @@ -857,7 +857,7 @@ bool os::create_attached_thread(JavaThread* thread) {
#endif

// Allocate the OSThread object
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();

if (osthread == nullptr) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/bsd/os_bsd.cpp
Expand Up @@ -586,7 +586,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
assert(thread->osthread() == nullptr, "caller responsible");

// Allocate the OSThread object
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();
if (osthread == nullptr) {
return false;
}
Expand Down Expand Up @@ -679,7 +679,7 @@ bool os::create_attached_thread(JavaThread* thread) {
#endif

// Allocate the OSThread object
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();

if (osthread == nullptr) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/linux/os_linux.cpp
Expand Up @@ -851,7 +851,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
assert(thread->osthread() == nullptr, "caller responsible");

// Allocate the OSThread object
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();
if (osthread == nullptr) {
return false;
}
Expand Down Expand Up @@ -975,7 +975,7 @@ bool os::create_attached_thread(JavaThread* thread) {
#endif

// Allocate the OSThread object
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();

if (osthread == nullptr) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os/windows/os_windows.cpp
Expand Up @@ -568,7 +568,7 @@ unsigned __stdcall os::win32::thread_native_entry(void* t) {
static OSThread* create_os_thread(Thread* thread, HANDLE thread_handle,
int thread_id) {
// Allocate the OSThread object
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();
if (osthread == nullptr) return nullptr;

// Initialize the JDK library's interrupt event.
Expand Down Expand Up @@ -673,7 +673,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
unsigned thread_id;

// Allocate the OSThread object
OSThread* osthread = new OSThread();
OSThread* osthread = new (std::nothrow) OSThread();
if (osthread == nullptr) {
return false;
}
Expand Down

1 comment on commit 3cb606e

@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.