Skip to content
Permalink
Browse files

src: make Environment::is_stopping_worker inline

Fixes a TODO comment.

PR-URL: #21720
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
maclover7 committed Jul 9, 2018
1 parent 8174d0c commit fcfd3e1bac0c3c62360829aeac4c63a62a2f02f5
Showing with 7 additions and 8 deletions.
  1. +6 −0 src/env-inl.h
  2. +0 −5 src/env.cc
  3. +1 −3 src/env.h
@@ -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>
@@ -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();
}
@@ -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
@@ -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);
@@ -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);

0 comments on commit fcfd3e1

Please sign in to comment.
You can’t perform that action at this time.