!30 export ScopedSuspendAllThreads by implement in header file

Merge pull request !30 from changcheng/master
This commit is contained in:
openharmony_ci
2021-10-08 07:12:48 +00:00
committed by Gitee
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);