Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: make Environment::is_stopping_worker inline #21720

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "node_perf_common.h"
#include "node_context_data.h"
#include "tracing/agent.h"
#include "node_worker.h"

#include <stddef.h>
#include <stdint.h>
Expand Down Expand Up @@ -623,6 +624,11 @@ inline void Environment::remove_sub_worker_context(worker::Worker* context) {
sub_worker_contexts_.erase(context);
}

inline bool Environment::is_stopping_worker() const {
CHECK(!is_main_thread());
return worker_context_->is_stopped();
}

inline performance::performance_state* Environment::performance_state() {
return performance_state_.get();
}
Expand Down
5 changes: 0 additions & 5 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,4 @@ void Environment::stop_sub_worker_contexts() {
}
}

bool Environment::is_stopping_worker() const {
CHECK(!is_main_thread());
return worker_context_->is_stopped();
}

} // namespace node
4 changes: 1 addition & 3 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,6 @@ class Environment {
inline bool can_call_into_js() const;
inline void set_can_call_into_js(bool can_call_into_js);

// TODO(addaleax): This should be inline.
bool is_stopping_worker() const;

inline bool is_main_thread() const;
inline uint64_t thread_id() const;
inline void set_thread_id(uint64_t id);
Expand All @@ -734,6 +731,7 @@ class Environment {
inline void add_sub_worker_context(worker::Worker* context);
inline void remove_sub_worker_context(worker::Worker* context);
void stop_sub_worker_contexts();
inline bool is_stopping_worker() const;

inline void ThrowError(const char* errmsg);
inline void ThrowTypeError(const char* errmsg);
Expand Down