summaryrefslogtreecommitdiff
path: root/redo/uitask.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-19 10:07:42 -0400
committerPietro Gagliardi <[email protected]>2014-07-19 10:07:42 -0400
commite73e7ab733b0ab9deb30868a334da2642b7f456b (patch)
tree7a4d2b34dc2717abe1ec8994c9f87fdbe4bd1147 /redo/uitask.go
parent32061353a10a88503592355b3df549267ec82ae5 (diff)
Fixed more conversion kinks. Now for a major change...
Diffstat (limited to 'redo/uitask.go')
-rw-r--r--redo/uitask.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/redo/uitask.go b/redo/uitask.go
index 8b5e523..43068e7 100644
--- a/redo/uitask.go
+++ b/redo/uitask.go
@@ -5,6 +5,7 @@ package ui
import (
"runtime"
"sync"
+ "unsafe"
)
// Go initializes package ui.
@@ -42,7 +43,7 @@ func Stop() {
type event struct {
// All events internally return bool; those that don't will be wrapped around to return a dummy value.
- do func(c Doer) bool
+ do func() bool
lock sync.Mutex
}
@@ -50,31 +51,31 @@ type event struct {
func newEvent() *event {
return &event{
- do: func(c Doer) bool {
+ do: func() bool {
return false
},
}
}
-func (e *event) set(f func(Doer)) {
+func (e *event) set(f func()) {
e.lock.Lock()
defer e.lock.Unlock()
if f == nil {
- f = func(c Doer) {}
+ f = func() {}
}
- e.do = func(c Doer) bool {
- f(c)
+ e.do = func() bool {
+ f()
return false
}
}
-func (e *event) setbool(f func(Doer) bool) {
+func (e *event) setbool(f func() bool) {
e.lock.Lock()
defer e.lock.Unlock()
if f == nil {
- f = func(c Doer) bool {
+ f = func() bool {
return false
}
}
@@ -87,7 +88,7 @@ func (e *event) fire() bool {
e.lock.Lock()
defer e.lock.Unlock()
- return e.do(c)
+ return e.do()
}
// Common code for performing a requested action (ui.Do() or ui.Stop()).