ref: f77d7c2c3d578ae5a724e1e8b91656304dde75d0 aerc/worker/worker.go -rw-r--r-- 586 bytes
worker/types: fix Worker.Callbacks race condition

Worker.Process* functions were called in different goroutines than
Worker.Post*. Protect the map with a mutex. Also make the map unexported to
prevent external unprotected accesses.

Worker.Process* functions used to delete items from the map. However they
didn't delete the element they retrieved: callbacks[msg.InResponseTo()] was
read while callbacks[msg] was deleted. I'm not sure I understand why. I tried
to delete the element that was accessed - but this broke everything (UI froze
at "Connecting..."). I don't believe any elements were actually removed from
the map, so the new code just doesn't remove anything.
67d14977 — Markus Ongyerth 2 years ago
fallthrough in worker selection
Reduce boilerplate in worker/UI
Improve logging
Move worker into account tab
Misc idiomatic fixes
Parse account configuration
Initial pass on worker/UI message passing