changeset 50882:188a87cbfac3

8203843: BasicParState::default_estimated_thread_count(false) can return 0 in gtest Summary: Ensure minimum estimated thread count is 1. Reviewed-by: tschatzl, stuefe, rehn
author kbarrett
date Tue, 29 May 2018 16:02:23 -0400
parents 580744d900c8
children 896486c6e357
files src/hotspot/share/gc/shared/oopStorage.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shared/oopStorage.cpp	Tue May 29 15:50:27 2018 -0400
+++ b/src/hotspot/share/gc/shared/oopStorage.cpp	Tue May 29 16:02:23 2018 -0400
@@ -907,7 +907,8 @@
 // Parallel iteration support
 
 uint OopStorage::BasicParState::default_estimated_thread_count(bool concurrent) {
-  return concurrent ? ConcGCThreads : ParallelGCThreads;
+  uint configured = concurrent ? ConcGCThreads : ParallelGCThreads;
+  return MAX2(1u, configured);  // Never estimate zero threads.
 }
 
 OopStorage::BasicParState::BasicParState(const OopStorage* storage,