src/share/vm/gc_implementation/shared/suspendibleThreadSet.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/gc_implementation/shared/suspendibleThreadSet.cpp

src/share/vm/gc_implementation/shared/suspendibleThreadSet.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2014, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2014, 2015, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 36,57 **** --- 36,61 ---- MonitorLockerEx ml(STS_lock, Mutex::_no_safepoint_check_flag); while (_suspend_all) { ml.wait(Mutex::_no_safepoint_check_flag); } _nthreads++; + Thread::current()->set_has_joined_suspendible_thread_set(true); } void SuspendibleThreadSet::leave() { MonitorLockerEx ml(STS_lock, Mutex::_no_safepoint_check_flag); assert(_nthreads > 0, "Invalid"); + Thread::current()->set_has_joined_suspendible_thread_set(false); _nthreads--; if (_suspend_all) { ml.notify_all(); } } void SuspendibleThreadSet::yield() { + assert(Thread::current()->has_joined_suspendible_thread_set(), + "Must have joined"); if (_suspend_all) { MonitorLockerEx ml(STS_lock, Mutex::_no_safepoint_check_flag); if (_suspend_all) { _nthreads_stopped++; if (_nthreads_stopped == _nthreads) {
*** 70,79 **** --- 74,85 ---- } } } void SuspendibleThreadSet::synchronize() { + assert(Thread::current()->has_joined_suspendible_thread_set(), + "Must have joined"); assert(Thread::current()->is_VM_thread(), "Must be the VM thread"); if (ConcGCYieldTimeout > 0) { _suspend_all_start = os::elapsedTime(); } MonitorLockerEx ml(STS_lock, Mutex::_no_safepoint_check_flag);
*** 83,92 **** --- 89,100 ---- ml.wait(Mutex::_no_safepoint_check_flag); } } void SuspendibleThreadSet::desynchronize() { + assert(Thread::current()->has_joined_suspendible_thread_set(), + "Must have joined"); assert(Thread::current()->is_VM_thread(), "Must be the VM thread"); MonitorLockerEx ml(STS_lock, Mutex::_no_safepoint_check_flag); assert(_nthreads_stopped == _nthreads, "Invalid"); _suspend_all = false; ml.notify_all();
src/share/vm/gc_implementation/shared/suspendibleThreadSet.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File