1.1 --- a/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Wed Jul 27 12:33:33 2016 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1ParScanThreadState.cpp Thu Sep 01 06:16:05 2016 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -148,7 +148,9 @@ 1.11 do { 1.12 // Drain the overflow stack first, so other threads can steal. 1.13 while (_refs->pop_overflow(ref)) { 1.14 - dispatch_reference(ref); 1.15 + if (!_refs->try_push_to_taskqueue(ref)) { 1.16 + dispatch_reference(ref); 1.17 + } 1.18 } 1.19 1.20 while (_refs->pop_local(ref)) {