From c7b77d6e5e8f5c175d6422135b5e1d18ab7e64a8 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sun, 27 Oct 2024 01:24:30 +0900 Subject: [PATCH] fmsg: initialise dequeue prior to withhold/resume This fixes the hang on resume when no messages were ever printed. Signed-off-by: Ophestra Umiker --- internal/fmsg/defer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/fmsg/defer.go b/internal/fmsg/defer.go index cee3c73..deef58f 100644 --- a/internal/fmsg/defer.go +++ b/internal/fmsg/defer.go @@ -37,12 +37,14 @@ func Exit(code int) { } func Withhold() { + dequeueOnce.Do(dequeue) if wstate.CompareAndSwap(false, true) { withhold <- struct{}{} } } func Resume() { + dequeueOnce.Do(dequeue) if wstate.CompareAndSwap(true, false) { withhold <- struct{}{} }