diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-27 01:24:30 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-27 01:24:30 +0900 |
| commit | c7b77d6e5e8f5c175d6422135b5e1d18ab7e64a8 (patch) | |
| tree | f4404eedc9f4099bd69927a9d0167c463c51e5b1 /internal | |
| parent | 2f34627d3707517f447d8c94482f93575e9c1e72 (diff) | |
fmsg: initialise dequeue prior to withhold/resume
This fixes the hang on resume when no messages were ever printed.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/fmsg/defer.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/fmsg/defer.go b/internal/fmsg/defer.go index cee3c737..deef58f0 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{}{} } |
