diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-10 12:56:01 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-10 13:12:16 +0200 |
commit | e956e80c1fa1cc8aefcb1533e5acf5cf3c8ffdd9 (patch) | |
tree | 8f162f9162ca0dfa35841a9c734a0529764cb458 /core/command_queue_mt.h | |
parent | 03b13e0c695bb63043c3ca8665083bae1960aca4 (diff) |
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.
Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
Diffstat (limited to 'core/command_queue_mt.h')
-rw-r--r-- | core/command_queue_mt.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index 558453bdf5..2f2b3b783c 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -253,7 +253,8 @@ cmd->method = p_method; \ SEMIC_SEP_LIST(CMD_ASSIGN_PARAM, N); \ unlock(); \ - if (sync) sync->post(); \ + if (sync) \ + sync->post(); \ } #define CMD_RET_TYPE(N) CommandRet##N<T, M, COMMA_SEP_LIST(TYPE_ARG, N) COMMA(N) R> @@ -269,7 +270,8 @@ cmd->ret = r_ret; \ cmd->sync_sem = ss; \ unlock(); \ - if (sync) sync->post(); \ + if (sync) \ + sync->post(); \ ss->sem.wait(); \ ss->in_use = false; \ } @@ -286,7 +288,8 @@ SEMIC_SEP_LIST(CMD_ASSIGN_PARAM, N); \ cmd->sync_sem = ss; \ unlock(); \ - if (sync) sync->post(); \ + if (sync) \ + sync->post(); \ ss->sem.wait(); \ ss->in_use = false; \ } @@ -418,12 +421,14 @@ class CommandQueueMT { } bool flush_one(bool p_lock = true) { - if (p_lock) lock(); + if (p_lock) + lock(); tryagain: // tried to read an empty queue if (read_ptr == write_ptr) { - if (p_lock) unlock(); + if (p_lock) + unlock(); return false; } @@ -442,15 +447,18 @@ class CommandQueueMT { read_ptr += size; - if (p_lock) unlock(); + if (p_lock) + unlock(); cmd->call(); - if (p_lock) lock(); + if (p_lock) + lock(); cmd->post(); cmd->~CommandBase(); *(uint32_t *)&command_mem[size_ptr] &= ~1; - if (p_lock) unlock(); + if (p_lock) + unlock(); return true; } |