export ScopedSuspendAllThreads api

Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
This commit is contained in:
wengchangcheng
2021-10-07 14:57:01 +08:00
parent 65d9da55d0
commit 9cb60293f7
2 changed files with 11 additions and 15 deletions
-12
View File
@@ -43,18 +43,6 @@ void Rendezvous::SafepointEnd()
LOG(DEBUG, GC) << "Rendezvous: SafepointEnd exit";
}
ScopedSuspendAllThreads::ScopedSuspendAllThreads(Rendezvous *rendezvous) : rendezvous_(rendezvous)
{
ASSERT(rendezvous_ != nullptr);
rendezvous_->SafepointBegin();
}
ScopedSuspendAllThreads::~ScopedSuspendAllThreads()
{
ASSERT(rendezvous_ != nullptr);
rendezvous_->SafepointEnd();
}
ScopedSuspendAllThreadsRunning::ScopedSuspendAllThreadsRunning(Rendezvous *rendezvous) : rendezvous_(rendezvous)
{
ASSERT(rendezvous_ != nullptr);
+11 -3
View File
@@ -59,10 +59,18 @@ private:
NO_COPY_SEMANTIC(EmptyRendezvous);
};
class PANDA_PUBLIC_API ScopedSuspendAllThreads {
class ScopedSuspendAllThreads {
public:
explicit ScopedSuspendAllThreads(Rendezvous *rendezvous) ACQUIRE(*Locks::mutator_lock);
~ScopedSuspendAllThreads() RELEASE(*Locks::mutator_lock);
explicit ScopedSuspendAllThreads(Rendezvous *rendezvous) ACQUIRE(*Locks::mutator_lock) : rendezvous_(rendezvous)
{
ASSERT(rendezvous_ != nullptr);
rendezvous_->SafepointBegin();
}
~ScopedSuspendAllThreads() RELEASE(*Locks::mutator_lock)
{
ASSERT(rendezvous_ != nullptr);
rendezvous_->SafepointEnd();
}
NO_COPY_SEMANTIC(ScopedSuspendAllThreads);
NO_MOVE_SEMANTIC(ScopedSuspendAllThreads);