< prev index next >

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

Print this page

        

*** 25,51 **** #ifndef SHARE_VM_GC_SHARED_GCID_HPP #define SHARE_VM_GC_SHARED_GCID_HPP #include "memory/allocation.hpp" ! class GCId VALUE_OBJ_CLASS_SPEC { ! private: ! uint _id; ! GCId(uint id) : _id(id) {} ! GCId() { } // Unused ! static uint _next_id; static const uint UNDEFINED = (uint)-1; public: ! uint id() const { ! assert(_id != UNDEFINED, "Using undefined GC ID"); ! return _id; ! } ! bool is_undefined() const; ! static const GCId create(); ! static const GCId peek(); ! static const GCId undefined(); }; #endif // SHARE_VM_GC_SHARED_GCID_HPP --- 25,52 ---- #ifndef SHARE_VM_GC_SHARED_GCID_HPP #define SHARE_VM_GC_SHARED_GCID_HPP #include "memory/allocation.hpp" ! class GCId : public AllStatic { ! friend class GCIdMark; static uint _next_id; static const uint UNDEFINED = (uint)-1; + static const uint create(); public: ! // Returns the currently active GC id. Asserts that there is an active GC id. ! static const uint current(); ! // Same as current() but can return undefined() if no GC id is currently active ! static const uint current_raw(); ! static const uint undefined() { return UNDEFINED; } ! }; ! class GCIdMark : public StackObj { ! uint _gc_id; ! public: ! GCIdMark(); ! GCIdMark(uint gc_id); ! ~GCIdMark(); }; #endif // SHARE_VM_GC_SHARED_GCID_HPP
< prev index next >