summaryrefslogtreecommitdiff
path: root/src/buildtool/multithreading/notification_queue.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-08-05 12:40:04 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-08-07 14:43:19 +0200
commited6f31f4c9939d6cc8d4d317d561a94545750b0b (patch)
tree122e2a01c4a56b0fc25d94236d459101ffb80f65 /src/buildtool/multithreading/notification_queue.hpp
parent4989605b096701fee6f1049bdad0827f81d9fb00 (diff)
downloadjustbuild-ed6f31f4c9939d6cc8d4d317d561a94545750b0b.tar.gz
Replace classic C boolean operators with keywords
! => not; && => and, || => or
Diffstat (limited to 'src/buildtool/multithreading/notification_queue.hpp')
-rw-r--r--src/buildtool/multithreading/notification_queue.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildtool/multithreading/notification_queue.hpp b/src/buildtool/multithreading/notification_queue.hpp
index a9f476c2..f1c803e9 100644
--- a/src/buildtool/multithreading/notification_queue.hpp
+++ b/src/buildtool/multithreading/notification_queue.hpp
@@ -92,7 +92,7 @@ class NotificationQueue {
[[nodiscard]] auto pop() -> std::optional<Task> {
std::unique_lock lock{mutex_};
auto there_is_something_to_pop_or_we_are_done = [&]() {
- return !queue_.empty() || done_;
+ return not queue_.empty() or done_;
};
if (not there_is_something_to_pop_or_we_are_done()) {
total_workload_->Decrement();
@@ -113,7 +113,7 @@ class NotificationQueue {
// otherwise pops the front element of the queue and returns it
[[nodiscard]] auto try_pop() -> std::optional<Task> {
std::unique_lock lock{mutex_, std::try_to_lock};
- if (!lock || queue_.empty()) {
+ if (not lock or queue_.empty()) {
return std::nullopt;
}
auto t = std::move(queue_.front());
@@ -140,7 +140,7 @@ class NotificationQueue {
[[nodiscard]] auto try_push(FunctionType&& f) -> bool {
{
std::unique_lock lock{mutex_, std::try_to_lock};
- if (!lock) {
+ if (not lock) {
return false;
}
total_workload_->Increment();