Implement getter function for counter limit

This commit is contained in:
Matthijs Mekking
2024-11-29 14:29:08 +01:00
parent bbc16cc8e6
commit ca7d487357
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);
/*%<