< prev index next >

src/share/vm/gc/shared/gcId.cpp

Print this page

        

*** 22,42 **** * */ #include "precompiled.hpp" #include "gc/shared/gcId.hpp" - #include "runtime/safepoint.hpp" uint GCId::_next_id = 0; ! const GCId GCId::create() { ! return GCId(_next_id++); } ! const GCId GCId::peek() { ! return GCId(_next_id); } ! const GCId GCId::undefined() { ! return GCId(UNDEFINED); } ! bool GCId::is_undefined() const { ! return _id == UNDEFINED; } --- 22,51 ---- * */ #include "precompiled.hpp" #include "gc/shared/gcId.hpp" uint GCId::_next_id = 0; + uint GCId::_current_id = UNDEFINED; ! const uint GCId::create() { ! return _next_id++; } ! ! const uint GCId::current() { ! assert(_current_id != UNDEFINED, "Using undefined GC ID"); ! return _current_id; } ! ! GCIdMark::GCIdMark() { ! _previous_gc_id = GCId::_current_id; ! uint gc_id = GCId::create(); ! GCId::set_current(gc_id); ! DEBUG_ONLY(_gc_id = gc_id;) } ! ! GCIdMark::~GCIdMark() { ! assert(_gc_id == GCId::_current_id, err_msg("GCIdMarks for %u and %u overlap.", _gc_id, GCId::_current_id)); ! GCId::set_current(_previous_gc_id); } +
< prev index next >