From d63db64889952b160036e90bdb1eba024cf33712 Mon Sep 17 00:00:00 2001 From: dormando Date: Mon, 9 Aug 2021 14:06:49 -0700 Subject: logger: avoid polling without watchers Inspired by #768 - logger thread would wake up once per second looking for watchers or log entries, but without any watchers. Now sleeps on a condition. Note that if I ever actually get logger to syslog/stdout/stderr/etc working properly this will still always poll. --- logger.h | 1 + 1 file changed, 1 insertion(+) (limited to 'logger.h') diff --git a/logger.h b/logger.h index 5492f72..0f5377c 100644 --- a/logger.h +++ b/logger.h @@ -162,6 +162,7 @@ typedef struct { int sfd; /* client fd */ int id; /* id number for watcher list */ uint64_t skipped; /* lines skipped since last successful print */ + uint64_t min_gid; /* don't show log entries older than this GID */ bool failed_flush; /* recently failed to write out (EAGAIN), wait before retry */ enum logger_watcher_type t; /* stderr, client, syslog, etc */ uint16_t eflags; /* flags we are interested in */ -- cgit v1.2.1