diff --git a/src/brpc/reloadable_flags.h b/src/brpc/reloadable_flags.h index dabd86b5a8..60b7851f4b 100644 --- a/src/brpc/reloadable_flags.h +++ b/src/brpc/reloadable_flags.h @@ -21,6 +21,8 @@ #include "butil/reloadable_flags.h" +#define BRPC_VALIDATE_GFLAG(flag, validate_fn) BUTIL_VALIDATE_GFLAG(flag, validate_fn) + namespace brpc { extern bool PassValidate(const char*, bool); diff --git a/src/bthread/bthread.h b/src/bthread/bthread.h index 5055cb237b..f0a8e9754c 100644 --- a/src/bthread/bthread.h +++ b/src/bthread/bthread.h @@ -35,8 +35,6 @@ #include "bthread/id.h" #if defined(__cplusplus) && defined(BRPC_BTHREAD_TRACER) -#include "butil/resource_pool.h" -#include "bthread/task_meta.h" namespace bthread { // Assign a TaskMeta to the pthread and set the state to Running, // so that `stack_trace()' can trace the call stack of the pthread. diff --git a/src/bthread/task_tracer.cpp b/src/bthread/task_tracer.cpp index aacc433770..acdf920891 100644 --- a/src/bthread/task_tracer.cpp +++ b/src/bthread/task_tracer.cpp @@ -31,7 +31,7 @@ namespace bthread { DEFINE_bool(enable_fast_unwind, true, "Whether to enable fast unwind"); DEFINE_uint32(signal_trace_timeout_ms, 50, "Timeout for signal trace in ms"); -BRPC_VALIDATE_GFLAG(signal_trace_timeout_ms, butil::PositiveInteger); +BUTIL_VALIDATE_GFLAG(signal_trace_timeout_ms, butil::PositiveInteger); extern BAIDU_THREAD_LOCAL TaskMeta* pthread_fake_meta; diff --git a/src/butil/reloadable_flags.h b/src/butil/reloadable_flags.h index 9bb62d82f1..2cb11e9253 100644 --- a/src/butil/reloadable_flags.h +++ b/src/butil/reloadable_flags.h @@ -35,7 +35,7 @@ // This macro does not work for string-flags because they're thread-unsafe to // modify directly. To emphasize this, you have to write the validator by // yourself and use GFLAGS_NS::GetCommandLineOption() to acess the flag. -#define BRPC_VALIDATE_GFLAG(flag, validate_fn) \ +#define BUTIL_VALIDATE_GFLAG(flag, validate_fn) \ namespace butil_flags {} \ const int register_FLAGS_ ## flag ## _dummy \ __attribute__((__unused__)) = \ diff --git a/src/butil/time.h b/src/butil/time.h index 005f551b1c..61602ab52b 100644 --- a/src/butil/time.h +++ b/src/butil/time.h @@ -376,7 +376,7 @@ class Timer { }; Timer() : _stop(0), _start(0) {} - explicit Timer(const TimerType) { + explicit Timer(const TimerType) : Timer() { start(); }