Add forking handling for counter module

This commit is contained in:
Yinan Zhang
2020-04-15 14:52:01 -07:00
parent 2097e1945b
commit 4d970f8bfc
3 changed files with 26 additions and 0 deletions

View File

@@ -20,3 +20,18 @@ counter_accum_init(counter_accum_t *counter, uint64_t interval) {
return false;
}
void
counter_prefork(tsdn_t *tsdn, counter_accum_t *counter) {
LOCKEDINT_MTX_PREFORK(tsdn, counter->mtx);
}
void
counter_postfork_parent(tsdn_t *tsdn, counter_accum_t *counter) {
LOCKEDINT_MTX_POSTFORK_PARENT(tsdn, counter->mtx);
}
void
counter_postfork_child(tsdn_t *tsdn, counter_accum_t *counter) {
LOCKEDINT_MTX_POSTFORK_CHILD(tsdn, counter->mtx);
}