summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_timer.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-10-22 16:04:16 +0300
committerValentin Bartenev <vbart@nginx.com>2018-10-22 16:04:16 +0300
commitda0ef366dc1affa740618eb4f4baa8bbb62f8d70 (patch)
tree8eea7dedbfb8864d7281acb523a5f5dab68aec08 /src/nxt_timer.h
parentb20e995e80d236945ec8388dfee37257ce9e5445 (diff)
downloadunit-da0ef366dc1affa740618eb4f4baa8bbb62f8d70.tar.gz
unit-da0ef366dc1affa740618eb4f4baa8bbb62f8d70.tar.bz2
Handling of timers with bias.
Timers that don't require maximum precision (most of them, actually) can be triggered earlier or later within the bias interval. To reduce wakeups by timers, the expire function now triggers not only all timers that fall within the elapsed time, but also those whose bias falls within this interval.
Diffstat (limited to 'src/nxt_timer.h')
-rw-r--r--src/nxt_timer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nxt_timer.h b/src/nxt_timer.h
index 211564d6..4199f0dd 100644
--- a/src/nxt_timer.h
+++ b/src/nxt_timer.h
@@ -8,9 +8,9 @@
#define _NXT_TIMER_H_INCLUDED_
-/* Valid values are between 1ms to 255ms. */
-#define NXT_TIMER_DEFAULT_PRECISION 100
-//#define NXT_TIMER_DEFAULT_PRECISION 1
+/* Valid values are between 0ms to 255ms. */
+#define NXT_TIMER_DEFAULT_BIAS 50
+//#define NXT_TIMER_DEFAULT_BIAS 0
/*
@@ -25,7 +25,7 @@ typedef struct {
/* The rbtree node must be the first field. */
NXT_RBTREE_NODE (node);
- uint8_t precision;
+ uint8_t bias;
uint16_t change:14;
uint16_t enabled:1;