grawt/close_handler.go
2020-11-19 16:05:45 +03:00

24 lines
352 B
Go

package grawt
import (
"sync"
)
type CloseHandler struct {
waiter *Waiter
Quit chan struct{}
active bool
autoDone bool
wgDone bool
handlerFunc *func()
mu *sync.Mutex
}
func (ch *CloseHandler) Halt(err error) {
ch.waiter.Halt(err)
}
func (ch *CloseHandler) Done() {
ch.waiter.terminateHandler(ch, true)
}