< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page

        

*** 1267,1286 **** NonJavaThread::List NonJavaThread::_the_list; NonJavaThread::Iterator::Iterator() : _protect_enter(_the_list._protect.enter()), ! _current(OrderAccess::load_acquire(&_the_list._head)) {} NonJavaThread::Iterator::~Iterator() { _the_list._protect.exit(_protect_enter); } void NonJavaThread::Iterator::step() { assert(!end(), "precondition"); ! _current = OrderAccess::load_acquire(&_current->_next); } NonJavaThread::NonJavaThread() : Thread(), _next(NULL) { assert(BarrierSet::barrier_set() != NULL, "NonJavaThread created too soon!"); } --- 1267,1286 ---- NonJavaThread::List NonJavaThread::_the_list; NonJavaThread::Iterator::Iterator() : _protect_enter(_the_list._protect.enter()), ! _current(Atomic::load_acquire(&_the_list._head)) {} NonJavaThread::Iterator::~Iterator() { _the_list._protect.exit(_protect_enter); } void NonJavaThread::Iterator::step() { assert(!end(), "precondition"); ! _current = Atomic::load_acquire(&_current->_next); } NonJavaThread::NonJavaThread() : Thread(), _next(NULL) { assert(BarrierSet::barrier_set() != NULL, "NonJavaThread created too soon!"); }
*** 1289,1300 **** void NonJavaThread::add_to_the_list() { MutexLocker ml(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag); // Initialize BarrierSet-related data before adding to list. BarrierSet::barrier_set()->on_thread_attach(this); ! OrderAccess::release_store(&_next, _the_list._head); ! OrderAccess::release_store(&_the_list._head, this); } void NonJavaThread::remove_from_the_list() { { MutexLocker ml(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag); --- 1289,1300 ---- void NonJavaThread::add_to_the_list() { MutexLocker ml(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag); // Initialize BarrierSet-related data before adding to list. BarrierSet::barrier_set()->on_thread_attach(this); ! Atomic::release_store(&_next, _the_list._head); ! Atomic::release_store(&_the_list._head, this); } void NonJavaThread::remove_from_the_list() { { MutexLocker ml(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag);
< prev index next >