Skip to content

Commit

Permalink
fix clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
empiredan committed Nov 5, 2024
1 parent e68ab2c commit 15acc64
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/runtime/fault_injector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/task/task_engine.sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
3 changes: 3 additions & 0 deletions src/task/task_engine.sim.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions src/task/task_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 15acc64

Please sign in to comment.