Guarantee preview/previewClear ordering (#537)

* Use chan struct{} in place of chan bool

* Revert "nav.checkReg now returns a boolean instead of calling nav.preview"

* Guarantee preview/previewClear ordering

* Pass the file path to the cleaner script
This commit is contained in:
neeshy authored and GitHub committed 2020-12-27 04:23:03 +03:00
1 parent 72567c9237
commit 1e94f4533e
9 files changed
+48 -41

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@ var (
gCopyFile bool
gFileList []string
gConnList = make(map[int]net.Conn)
gQuitChan = make(chan bool, 1)
gQuitChan = make(chan struct{}, 1)
gListener net.Listener
)
@@ -115,7 +115,7 @@ Loop:
}
}
case "quit":
gQuitChan <- true
gQuitChan <- struct{}{}
for _, c := range gConnList {
fmt.Fprintln(c, "echo server is quitting...")
c.Close()