Implement ticker.

Implement ticker, which provides a simple API for ticking off some
number of events before indicating that the ticker has hit its limit.
This commit is contained in:
Jason Evans
2016-02-02 20:27:54 -08:00
committed by Jason Evans
parent 94451d184b
commit 9998000b2b
6 changed files with 163 additions and 2 deletions

View File

@@ -85,8 +85,8 @@ C_SRCS := $(srcroot)src/jemalloc.c $(srcroot)src/arena.c \
$(srcroot)src/extent.c $(srcroot)src/hash.c $(srcroot)src/huge.c \
$(srcroot)src/mb.c $(srcroot)src/mutex.c $(srcroot)src/pages.c \
$(srcroot)src/prof.c $(srcroot)src/quarantine.c $(srcroot)src/rtree.c \
$(srcroot)src/stats.c $(srcroot)src/tcache.c $(srcroot)src/time.c \
$(srcroot)src/tsd.c $(srcroot)src/util.c
$(srcroot)src/stats.c $(srcroot)src/tcache.c $(srcroot)src/ticker.c \
$(srcroot)src/time.c $(srcroot)src/tsd.c $(srcroot)src/util.c
ifeq ($(enable_valgrind), 1)
C_SRCS += $(srcroot)src/valgrind.c
endif
@@ -143,6 +143,7 @@ TESTS_UNIT := $(srcroot)test/unit/atomic.c \
$(srcroot)test/unit/SFMT.c \
$(srcroot)test/unit/size_classes.c \
$(srcroot)test/unit/stats.c \
$(srcroot)test/unit/ticker.c \
$(srcroot)test/unit/time.c \
$(srcroot)test/unit/tsd.c \
$(srcroot)test/unit/util.c \