From 867bbc45600f99a500f2671f8532614c00cfb1af Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Tue, 10 May 2022 13:06:41 -0400 Subject: [PATCH] 8286445.cr0 --- .../nsk/share/jvmti/jvmti_tools.cpp | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/jvmti_tools.cpp b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/jvmti_tools.cpp index fae205bd86e..550814ab54a 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/jvmti_tools.cpp +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/jvmti_tools.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -592,20 +592,21 @@ int isThreadExpected(jvmtiEnv *jvmti, jthread thread) { jvmtiThreadInfo threadinfo; NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(thread, &threadinfo)); - if (strcmp(threadinfo.name, vm_jfr_buffer_thread_name) == 0) - return 0; - - if (strcmp(threadinfo.name, jfr_request_timer_thread_name) == 0) - return 0; - - if (strcmp(threadinfo.name, graal_management_bean_registration_thread_name) == 0) - return 0; + int ret_code = 1; + if (strcmp(threadinfo.name, vm_jfr_buffer_thread_name) == 0) { + ret_code = 0; + } else if (strcmp(threadinfo.name, jfr_request_timer_thread_name) == 0) { + ret_code = 0; + } else if (strcmp(threadinfo.name, graal_management_bean_registration_thread_name) == 0) { + ret_code = 0; + } else if ((strlen(threadinfo.name) > prefixLength) && + strncmp(threadinfo.name, graal_compiler_thread_name_prefix, prefixLength) == 0) { + ret_code = 0; + } - if ((strlen(threadinfo.name) > prefixLength) && - strncmp(threadinfo.name, graal_compiler_thread_name_prefix, prefixLength) == 0) - return 0; + NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threadinfo.name)); - return 1; + return ret_code; } #define SLEEP_DELAY 10L -- 2.28.0