Implement getter function for counter limit

(cherry picked from commit ca7d487357)
This commit is contained in:
Matthijs Mekking 2024-11-29 14:29:08 +01:00
parent 5a806910a8
commit 3d0559621b
2 changed files with 13 additions and 0 deletions

View file

@ -80,6 +80,13 @@ isc_counter_setlimit(isc_counter_t *counter, int limit) {
atomic_store(&counter->limit, limit);
}
int
isc_counter_getlimit(isc_counter_t *counter) {
REQUIRE(VALID_COUNTER(counter));
return atomic_load_acquire(&counter->limit);
}
void
isc_counter_attach(isc_counter_t *source, isc_counter_t **targetp) {
REQUIRE(VALID_COUNTER(source));

View file

@ -68,6 +68,12 @@ isc_counter_setlimit(isc_counter_t *counter, int limit);
* Set the counter limit.
*/
int
isc_counter_getlimit(isc_counter_t *counter);
/*%<
* Get the counter limit.
*/
void
isc_counter_attach(isc_counter_t *source, isc_counter_t **targetp);
/*%<