diff --git a/src/runtime/fault_injector.cpp b/src/runtime/fault_injector.cpp index c20313850b..2f5367d635 100644 --- a/src/runtime/fault_injector.cpp +++ b/src/runtime/fault_injector.cpp @@ -320,8 +320,9 @@ void fault_injector::install(service_spec &spec) read_config("task..default", default_opt, nullptr); for (int i = 0; i <= dsn::task_code::max(); i++) { - if (i == TASK_CODE_INVALID) + if (i == TASK_CODE_INVALID) { continue; + } std::string section_name = fmt::format("task.{}", dsn::task_code(i)); task_spec *spec = task_spec::get(i); @@ -330,8 +331,9 @@ void fault_injector::install(service_spec &spec) fj_opt &lopt = s_fj_opts[i]; read_config(section_name.c_str(), lopt, &default_opt); - if (!lopt.fault_injection_enabled) + if (!lopt.fault_injection_enabled) { continue; + } spec->on_task_enqueue.put_back(fault_on_task_enqueue, "fault_injector"); spec->on_task_begin.put_back(fault_on_task_begin, "fault_injector"); diff --git a/src/task/task_engine.sim.cpp b/src/task/task_engine.sim.cpp index aee04ef598..256d669280 100644 --- a/src/task/task_engine.sim.cpp +++ b/src/task/task_engine.sim.cpp @@ -191,7 +191,7 @@ void sim_lock_provider::unlock() } sim_lock_nr_provider::sim_lock_nr_provider(lock_nr_provider *inner_provider) - : lock_nr_provider(inner_provider), _current_holder(-1), _lock_depth(0), _sema(1, nullptr) + : lock_nr_provider(inner_provider), _lock_depth(0), _current_holder(-1), _sema(1, nullptr) { } diff --git a/src/task/task_engine.sim.h b/src/task/task_engine.sim.h index e969c3a997..83e1c1a9c9 100644 --- a/src/task/task_engine.sim.h +++ b/src/task/task_engine.sim.h @@ -101,6 +101,9 @@ class sim_lock_provider : public lock_provider int _lock_depth; // 0 for not locked; int _current_holder; // -1 for invalid sim_semaphore_provider _sema; + + DISALLOW_COPY_AND_ASSIGN(sim_lock_provider); + DISALLOW_MOVE_AND_ASSIGN(sim_lock_provider); }; class sim_lock_nr_provider : public lock_nr_provider diff --git a/src/task/task_spec.cpp b/src/task/task_spec.cpp index b322e46e49..aa80ed9d04 100644 --- a/src/task/task_spec.cpp +++ b/src/task/task_spec.cpp @@ -197,20 +197,23 @@ bool task_spec::init() task_spec default_spec( 0, "placeholder", TASK_TYPE_COMPUTE, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAULT); - if (!read_config("task..default", default_spec, nullptr)) + if (!read_config("task..default", default_spec, nullptr)) { return false; + } for (int code = 0; code <= dsn::task_code::max(); code++) { - if (code == TASK_CODE_INVALID) + if (code == TASK_CODE_INVALID) { continue; + } std::string section_name = std::string("task.") + std::string(dsn::task_code(code).to_string()); task_spec *spec = task_spec::get(code); CHECK_NOTNULL(spec, ""); - if (!read_config(section_name.c_str(), *spec, &default_spec)) + if (!read_config(section_name.c_str(), *spec, &default_spec)) { return false; + } if (code == TASK_CODE_EXEC_INLINED) { spec->allow_inline = true;