8329103: assert(!thread->in_asgct()) failed during multi-mode profiling
Reviewed-by: dholmes, sspitsyn
This commit is contained in:
parent
bc546c21a5
commit
6b1b0e9d45
@ -657,15 +657,17 @@ protected:
|
|||||||
class ThreadInAsgct {
|
class ThreadInAsgct {
|
||||||
private:
|
private:
|
||||||
Thread* _thread;
|
Thread* _thread;
|
||||||
|
bool _saved_in_asgct;
|
||||||
public:
|
public:
|
||||||
ThreadInAsgct(Thread* thread) : _thread(thread) {
|
ThreadInAsgct(Thread* thread) : _thread(thread) {
|
||||||
assert(thread != nullptr, "invariant");
|
assert(thread != nullptr, "invariant");
|
||||||
assert(!thread->in_asgct(), "invariant");
|
// Allow AsyncGetCallTrace to be reentrant - save the previous state.
|
||||||
|
_saved_in_asgct = thread->in_asgct();
|
||||||
thread->set_in_asgct(true);
|
thread->set_in_asgct(true);
|
||||||
}
|
}
|
||||||
~ThreadInAsgct() {
|
~ThreadInAsgct() {
|
||||||
assert(_thread->in_asgct(), "invariant");
|
assert(_thread->in_asgct(), "invariant");
|
||||||
_thread->set_in_asgct(false);
|
_thread->set_in_asgct(_saved_in_asgct);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user