diff options
author | Martin Mares <mj@ucw.cz> | 1999-10-29 14:08:49 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-10-29 14:08:49 +0200 |
commit | 0d70292d88276a9883ab8bc15b00e6a2e2fe4487 (patch) | |
tree | 19985b61964aacd88b239cefbea547cca85eccb9 /nest/proto.c | |
parent | 92af6f309b9283482384bd9bbd0351cd71e3cf1d (diff) | |
download | bird-0d70292d88276a9883ab8bc15b00e6a2e2fe4487.tar bird-0d70292d88276a9883ab8bc15b00e6a2e2fe4487.zip |
Events now return a value. If it's non-zero, the event is re-queued
for processing in next event cycle. This can be used to prevent background
actions (hint: user commands) from hogging the CPU for too long time.
Diffstat (limited to 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c index bbf5d59..3430176 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -36,7 +36,7 @@ static event *proto_flush_event; static char *p_states[] = { "DOWN", "START", "UP", "STOP" }; static char *c_states[] = { "HUNGRY", "FEEDING", "HAPPY", "FLUSHING" }; -static void proto_flush_all(void *); +static int proto_flush_all(void *); static void proto_enqueue(list *l, struct proto *p) @@ -329,7 +329,7 @@ proto_fell_down(struct proto *p) proto_rethink_goal(p); } -static void +static int proto_feed(void *P) { struct proto *p = P; @@ -341,6 +341,7 @@ proto_feed(void *P) p->core_state = FS_HAPPY; proto_relink(p); DBG("Protocol %s up and running\n", p->name); + return 0; } void @@ -401,7 +402,7 @@ proto_notify_state(struct proto *p, unsigned ps) proto_relink(p); } -static void +static int proto_flush_all(void *unused) { struct proto *p; @@ -417,4 +418,5 @@ proto_flush_all(void *unused) proto_relink(p); proto_fell_down(p); } + return 0; } |