mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-09 09:58:43 +00:00
8273221: Guard GCIdMark against nested calls
Reviewed-by: tschatzl, kbarrett
This commit is contained in:
parent
4d25e6f6c7
commit
b4e5b28b86
@ -67,14 +67,16 @@ size_t GCId::print_prefix(char* buf, size_t len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
GCIdMark::GCIdMark() : _previous_gc_id(currentNamedthread()->gc_id()) {
|
||||
GCIdMark::GCIdMark() {
|
||||
assert(currentNamedthread()->gc_id() == GCId::undefined(), "nested");
|
||||
currentNamedthread()->set_gc_id(GCId::create());
|
||||
}
|
||||
|
||||
GCIdMark::GCIdMark(uint gc_id) : _previous_gc_id(currentNamedthread()->gc_id()) {
|
||||
GCIdMark::GCIdMark(uint gc_id) {
|
||||
assert(currentNamedthread()->gc_id() == GCId::undefined(), "nested");
|
||||
currentNamedthread()->set_gc_id(gc_id);
|
||||
}
|
||||
|
||||
GCIdMark::~GCIdMark() {
|
||||
currentNamedthread()->set_gc_id(_previous_gc_id);
|
||||
currentNamedthread()->set_gc_id(GCId::undefined());
|
||||
}
|
||||
|
||||
@ -47,9 +47,6 @@ public:
|
||||
};
|
||||
|
||||
class GCIdMark : public StackObj {
|
||||
private:
|
||||
const uint _previous_gc_id;
|
||||
|
||||
public:
|
||||
GCIdMark();
|
||||
GCIdMark(uint gc_id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user