summaryrefslogtreecommitdiff
path: root/proto/bfd
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2021-08-04 22:48:51 +0200
committerMaria Matejka <mq@ucw.cz>2021-11-22 19:05:43 +0100
commita4451535c69b8f934523905a8131ae2f16be2146 (patch)
treea600241cfdb94b6ecafb1b965c554789b453ca75 /proto/bfd
parenta2af807357875f866f149b0f6db4d463d4533204 (diff)
Unified time for whole BIRD
In previous versions, every thread used its own time structures, effectively leading to different time in every thread and strange logging messages. The time processing code now uses global atomic variables to keep current time available for fast concurrent reading and safe updates.
Diffstat (limited to 'proto/bfd')
-rw-r--r--proto/bfd/io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/bfd/io.c b/proto/bfd/io.c
index 8fdc84fb..c5f1e024 100644
--- a/proto/bfd/io.c
+++ b/proto/bfd/io.c
@@ -172,7 +172,7 @@ events_init(struct birdloop *loop)
static void
events_fire(struct birdloop *loop)
{
- times_update(&loop->time);
+ times_update();
ev_run_list(&loop->event_list);
}
@@ -332,7 +332,7 @@ sockets_fire(struct birdloop *loop)
sock **psk = loop->poll_sk.data;
int poll_num = loop->poll_fd.used - 1;
- times_update(&loop->time);
+ times_update();
/* Last fd is internal wakeup fd */
if (pfd[poll_num].revents & POLLIN)
@@ -365,7 +365,7 @@ sockets_fire(struct birdloop *loop)
* Birdloop
*/
-static void * birdloop_main(void *arg);
+static void *birdloop_main(void *arg);
struct birdloop *
birdloop_new(void)
@@ -461,7 +461,7 @@ birdloop_main(void *arg)
events_fire(loop);
timers_fire(&loop->time);
- times_update(&loop->time);
+ times_update();
if (events_waiting(loop))
timeout = 0;
else if (t = timers_first(&loop->time))