Skip to content

Commit

Permalink
reactor: Add and use stopped() getter
Browse files Browse the repository at this point in the history
To facilitate next patch.

Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
xemul committed Jun 18, 2024
1 parent cee4698 commit 594a8fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/seastar/core/reactor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ public:
/// Register a user-defined signal handler
void handle_signal(int signo, noncopyable_function<void ()>&& handler);
void wakeup();
/// @private
bool stopped() const noexcept { return _stopped; }

private:
class signals {
Expand Down
2 changes: 1 addition & 1 deletion src/core/reactor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3602,7 +3602,7 @@ void smp_message_queue::submit_item(shard_id t, smp_timeout_clock::time_point ti

void smp_message_queue::respond(work_item* item) {
_completed_fifo.push_back(item);
if (_completed_fifo.size() >= batch_size || engine()._stopped) {
if (_completed_fifo.size() >= batch_size || engine().stopped()) {
flush_response_batch();
}
}
Expand Down

0 comments on commit 594a8fb

Please sign in to comment.