fix: rework sync logic

This commit is contained in:
jar3b
2020-10-30 18:20:27 +03:00
parent ed59ea1d0a
commit 486382b9d6
4 changed files with 37 additions and 14 deletions

View File

@@ -1,9 +1,6 @@
package grawt
import "sync"
type CloseHandler struct {
sync.Mutex
waiter *Waiter
Quit chan struct{}
active bool
@@ -14,7 +11,3 @@ type CloseHandler struct {
func (ch *CloseHandler) Halt(err error) {
ch.waiter.Halt(err)
}
func (ch *CloseHandler) Done() {
ch.waiter.terminateHandler(ch, true)
}