mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
bugfix: Issue #291
This commit is contained in:
@@ -117,7 +117,6 @@ move_list(struct timer *T, int level, int idx) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
timer_shift(struct timer *T) {
|
timer_shift(struct timer *T) {
|
||||||
LOCK(T);
|
|
||||||
int mask = TIME_NEAR;
|
int mask = TIME_NEAR;
|
||||||
uint32_t ct = ++T->time;
|
uint32_t ct = ++T->time;
|
||||||
if (ct == 0) {
|
if (ct == 0) {
|
||||||
@@ -137,7 +136,6 @@ timer_shift(struct timer *T) {
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UNLOCK(T);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@@ -160,7 +158,6 @@ dispatch_list(struct timer_node *current) {
|
|||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
timer_execute(struct timer *T) {
|
timer_execute(struct timer *T) {
|
||||||
LOCK(T);
|
|
||||||
int idx = T->time & TIME_NEAR_MASK;
|
int idx = T->time & TIME_NEAR_MASK;
|
||||||
|
|
||||||
while (T->near[idx].head.next) {
|
while (T->near[idx].head.next) {
|
||||||
@@ -170,12 +167,12 @@ timer_execute(struct timer *T) {
|
|||||||
dispatch_list(current);
|
dispatch_list(current);
|
||||||
LOCK(T);
|
LOCK(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
UNLOCK(T);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
timer_update(struct timer *T) {
|
timer_update(struct timer *T) {
|
||||||
|
LOCK(T);
|
||||||
|
|
||||||
// try to dispatch timeout 0 (rare condition)
|
// try to dispatch timeout 0 (rare condition)
|
||||||
timer_execute(T);
|
timer_execute(T);
|
||||||
|
|
||||||
@@ -184,6 +181,7 @@ timer_update(struct timer *T) {
|
|||||||
|
|
||||||
timer_execute(T);
|
timer_execute(T);
|
||||||
|
|
||||||
|
UNLOCK(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct timer *
|
static struct timer *
|
||||||
|
|||||||
Reference in New Issue
Block a user