Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 314b47d

Browse filesBrowse files
TimothyGutargos
authored andcommitted
src: add Env::profiler_idle_notifier_started()
Refs: ayojs/ayo#93 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> PR-URL: #20876 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
1 parent 5209ff9 commit 314b47d
Copy full SHA for 314b47d

File tree

Expand file treeCollapse file tree

3 files changed

+12
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-0
lines changed
Open diff view settings
Collapse file

‎src/env-inl.h‎

Copy file name to clipboardExpand all lines: src/env-inl.h
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ inline Environment* Environment::GetThreadLocalEnv() {
322322
return static_cast<Environment*>(uv_key_get(&thread_local_env));
323323
}
324324

325+
inline bool Environment::profiler_idle_notifier_started() const {
326+
return profiler_idle_notifier_started_;
327+
}
328+
325329
inline v8::Isolate* Environment::isolate() const {
326330
return isolate_;
327331
}
Collapse file

‎src/env.cc‎

Copy file name to clipboardExpand all lines: src/env.cc
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ void Environment::CleanupHandles() {
263263
}
264264

265265
void Environment::StartProfilerIdleNotifier() {
266+
if (profiler_idle_notifier_started_)
267+
return;
268+
269+
profiler_idle_notifier_started_ = true;
270+
266271
uv_prepare_start(&idle_prepare_handle_, [](uv_prepare_t* handle) {
267272
Environment* env = ContainerOf(&Environment::idle_prepare_handle_, handle);
268273
env->isolate()->SetIdle(true);
@@ -275,6 +280,7 @@ void Environment::StartProfilerIdleNotifier() {
275280
}
276281

277282
void Environment::StopProfilerIdleNotifier() {
283+
profiler_idle_notifier_started_ = false;
278284
uv_prepare_stop(&idle_prepare_handle_);
279285
uv_check_stop(&idle_check_handle_);
280286
}
Collapse file

‎src/env.h‎

Copy file name to clipboardExpand all lines: src/env.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ class Environment {
615615

616616
void StartProfilerIdleNotifier();
617617
void StopProfilerIdleNotifier();
618+
inline bool profiler_idle_notifier_started() const;
618619

619620
inline v8::Isolate* isolate() const;
620621
inline tracing::Agent* tracing_agent() const;
@@ -840,6 +841,7 @@ class Environment {
840841
uv_idle_t immediate_idle_handle_;
841842
uv_prepare_t idle_prepare_handle_;
842843
uv_check_t idle_check_handle_;
844+
bool profiler_idle_notifier_started_ = false;
843845

844846
AsyncHooks async_hooks_;
845847
ImmediateInfo immediate_info_;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.