Skip to content

Commit ae8a367

Browse files
committed
Minor code improvements
1 parent 89b2e29 commit ae8a367

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

include/scheduling/scheduling.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ class Array {
8080
[[nodiscard]] int Capacity() const { return capacity_; }
8181

8282
private:
83-
int capacity_;
84-
int mask_;
83+
const int capacity_, mask_;
8584
std::atomic<T>* buffer_;
8685
};
8786

@@ -101,7 +100,7 @@ class WorkStealingDeque {
101100
WorkStealingDeque& operator=(WorkStealingDeque&&) = delete;
102101

103102
~WorkStealingDeque() noexcept {
104-
for (auto array : garbage_) {
103+
for (auto* array : garbage_) {
105104
delete array;
106105
}
107106
delete array_.load();
@@ -582,7 +581,7 @@ class SCHEDULING_API ThreadPool {
582581
}
583582

584583
static thread_local unsigned index_;
585-
unsigned queues_count_;
584+
const unsigned queues_count_;
586585
std::atomic_flag stop_;
587586
std::atomic<unsigned> tasks_count_;
588587
std::vector<std::thread> threads_;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy