diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-10-17 15:16:10 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-18 22:20:44 +0200 |
commit | 7016c6f86ae09b3e49eab665aa013628db4ee102 (patch) | |
tree | 3ffe1eebd8fea0e043ffcdbf3376a24aa51a2acc /aerc.go | |
parent | 556f346f96946a54223798685c445ec413a4031e (diff) | |
download | aerc-7016c6f86ae09b3e49eab665aa013628db4ee102.tar.gz |
aercmsg: add AercFuncMsg and QueueFunc
Introduce AercFuncMsg and QueueFunc. These are used in combination to
queue a function to be run in the main goroutine. This can be used to
prevent data races in delayed function calls (ie from debounce
functions).
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'aerc.go')
-rw-r--r-- | aerc.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -247,6 +247,8 @@ func main() { switch event := event.(type) { case tcell.Event: ui.HandleEvent(event) + case *libui.AercFuncMsg: + event.Func() case types.WorkerMessage: aerc.HandleMessage(event) } |