mirror of
https://github.com/openharmony/ark_runtime_core.git
synced 2026-07-18 18:24:30 -04:00
export ScopedSuspendAllThreads api
Signed-off-by: wengchangcheng <wengchangcheng@huawei.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user