Skip to content

Commit

Permalink
shared_token_bucket: resolve FIXME
Browse files Browse the repository at this point in the history
The specialization of 'struct rovers' for 'capped_release::no'
does not support 'release()' member function. If it was called,
it would call abort().

This change resolves FIXME that demanded this member function to
not be compiled. Usage of '= delete' was introduced to break the
compilation if the user tries to use release().

Signed-off-by: Patryk Wrobel <[email protected]>
  • Loading branch information
pwrobelse committed Jun 28, 2024
1 parent eaf51a3 commit 806c5e1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/seastar/util/shared_token_bucket.hh
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ struct rovers<T, capped_release::no> {
return wrapping_difference(tail.load(std::memory_order_relaxed) + limit, head.load(std::memory_order_relaxed));
}

void release(T) {
std::abort(); // FIXME shouldn't even be compiled
}
void release(T) = delete;
};

template <typename T, typename Period, capped_release Capped, typename Clock = std::chrono::steady_clock>
Expand Down

0 comments on commit 806c5e1

Please sign in to comment.