--- a/src/hotspot/share/gc/shared/gcId.hpp Wed Feb 21 07:46:40 2018 +0100
+++ b/src/hotspot/share/gc/shared/gcId.hpp Wed Feb 21 07:50:33 2018 +0100
@@ -28,38 +28,32 @@
#include "memory/allocation.hpp"
class GCId : public AllStatic {
+private:
friend class GCIdMark;
- friend class GCIdMarkAndRestore;
+
static uint _next_id;
static const uint UNDEFINED = (uint)-1;
- static const uint create();
+ static uint create();
- public:
+public:
// Returns the currently active GC id. Asserts that there is an active GC id.
- static const uint current();
+ static uint current();
// Same as current() but can return undefined() if no GC id is currently active
- static const uint current_or_undefined();
+ static uint current_or_undefined();
// Returns the next expected GCId.
- static const uint peek();
- static const uint undefined() { return UNDEFINED; }
+ static uint peek();
+ static uint undefined() { return UNDEFINED; }
static size_t print_prefix(char* buf, size_t len);
};
class GCIdMark : public StackObj {
- uint _gc_id;
- public:
+private:
+ const uint _previous_gc_id;
+
+public:
GCIdMark();
GCIdMark(uint gc_id);
~GCIdMark();
};
-class GCIdMarkAndRestore : public StackObj {
- uint _gc_id;
- uint _previous_gc_id;
- public:
- GCIdMarkAndRestore();
- GCIdMarkAndRestore(uint gc_id);
- ~GCIdMarkAndRestore();
-};
-
#endif // SHARE_VM_GC_SHARED_GCID_HPP