Skip to content

Commit 8864e8a

Browse files
committed
Fix types for compilation on 32 bit machines
1 parent fc4f38c commit 8864e8a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/reactor-cpp/scheduler.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ private:
6565
std::atomic<std::ptrdiff_t> size_{0};
6666
Semaphore sem_{0};
6767
std::ptrdiff_t waiting_workers_{0};
68-
const unsigned int num_workers_;
68+
const std::ptrdiff_t num_workers_;
6969
log::NamedLogger& log_;
7070

7171
public:
72-
explicit ReadyQueue(log::NamedLogger& log, unsigned num_workers)
72+
explicit ReadyQueue(log::NamedLogger& log, std::ptrdiff_t num_workers)
7373
: num_workers_(num_workers)
7474
, log_(log) {}
7575

lib/scheduler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void ReadyQueue::fill_up(std::vector<Reaction*>& ready_reactions) {
137137
// one worker running running, new_size - running_workers indicates the
138138
// number of additional workers needed to process all reactions.
139139
waiting_workers_ += -old_size;
140-
auto running_workers = num_workers_ - waiting_workers_;
140+
std::ptrdiff_t running_workers{num_workers_ - waiting_workers_};
141141
auto workers_to_wakeup = std::min(waiting_workers_, new_size - running_workers);
142142

143143
// wakeup other workers_

0 commit comments

Comments
 (0)