From 65c9a187a9926181534939480a4034b06b10b71e Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sat, 20 Sep 2014 02:14:11 +0200 Subject: kern/evcnt: new evcnt_add function --- kern/evcnt.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'kern') diff --git a/kern/evcnt.h b/kern/evcnt.h index a6caf96b..f585fad0 100644 --- a/kern/evcnt.h +++ b/kern/evcnt.h @@ -64,6 +64,18 @@ evcnt_inc(struct evcnt *evcnt) evcnt->count++; } +/* + * Batched increment. + * + * It is the responsibility of the caller to synchronize access to the + * counter. + */ +static inline void +evcnt_add(struct evcnt *evcnt, unsigned long long delta) +{ + evcnt->count += delta; +} + /* * Obtain the current value of the given counter. * -- cgit v1.2.3