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]>

Closes #2308
  • Loading branch information
pwrobelse authored and xemul committed Jun 28, 2024
1 parent 4cf3137 commit 0244a45
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 0244a45

Please sign in to comment.