fmsg: initialise dequeue prior to withhold/resume
test / test (push) Successful in 23s
Details
test / test (push) Successful in 23s
Details
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() {
|
||||
dequeueOnce.Do(dequeue)
|
||||
if wstate.CompareAndSwap(false, true) {
|
||||
withhold <- struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
func Resume() {
|
||||
dequeueOnce.Do(dequeue)
|
||||
if wstate.CompareAndSwap(true, false) {
|
||||
withhold <- struct{}{}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue