summaryrefslogtreecommitdiff
path: root/redo/uitask.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-13 01:14:55 -0400
committerPietro Gagliardi <[email protected]>2014-07-13 01:14:55 -0400
commitf36451d26e7a4a83f90933b0d087c7d9c0d81001 (patch)
treeab11f7396a87ef093c50eea3e4bce662909e7fad /redo/uitask.go
parent5bc9a75f0ac0528dd6fbababac6cf566f247a4b3 (diff)
Added Stop() and implemented it on Windows.
Diffstat (limited to 'redo/uitask.go')
-rw-r--r--redo/uitask.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/redo/uitask.go b/redo/uitask.go
index 462a24b..b4fa77c 100644
--- a/redo/uitask.go
+++ b/redo/uitask.go
@@ -19,7 +19,19 @@ func Go() error {
return nil
}
-// TODO Stop
+// Stop returns a Request for package ui to stop.
+// Some time after this request is received, Go() will return without performing any final cleanup.
+// If Stop is issued during an event handler, it will be registered when the event handler returns.
+func Stop() *Request {
+ c := make(chan interface{})
+ return &Request{
+ op: func() {
+ uistop()
+ c <- struct{}{}
+ },
+ resp: c,
+ }
+}
// This is the ui main loop.
// It is spawned by Go as a goroutine.