fmsg: initialise dequeue prior to withhold/resume
All checks were successful
test / test (push) Successful in 23s
All checks were successful
test / test (push) Successful in 23s
This fixes the hang on resume when no messages were ever printed. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
2f34627d37
commit
c7b77d6e5e
@ -37,12 +37,14 @@ func Exit(code int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Withhold() {
|
func Withhold() {
|
||||||
|
dequeueOnce.Do(dequeue)
|
||||||
if wstate.CompareAndSwap(false, true) {
|
if wstate.CompareAndSwap(false, true) {
|
||||||
withhold <- struct{}{}
|
withhold <- struct{}{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Resume() {
|
func Resume() {
|
||||||
|
dequeueOnce.Do(dequeue)
|
||||||
if wstate.CompareAndSwap(true, false) {
|
if wstate.CompareAndSwap(true, false) {
|
||||||
withhold <- struct{}{}
|
withhold <- struct{}{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user