1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2025-10-14 04:35:19 +02:00
aerc/worker
Marco Munizaga 979ec6dd47 worker: fix race condition
There is a race condition where a callback may never be called if the
worker finishes handling a message before the callback is registered.

In practice, with Go 1.25.0, I have not seen the callback lose this
race. However, adding an explicit runtime.Gosched() before registering
the callback does cause it to consistently lose the race. Therefore,
it's probably best to patch this as whether to yield the Goroutine is
outside our control.

Signed-off-by: Marco Munizaga <git@marcopolo.io>
Reviewed-by: Simon Martin <simon@nasilyan.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2025-09-23 14:09:25 +02:00
..
handlers watchers: move filesystem monitoring stuff in lib 2023-08-04 11:32:40 +02:00
imap imap: always consider recently received unread messages as recent 2025-08-28 10:16:02 +02:00
jmap tag: allow to toggle tags 2025-03-30 22:10:58 +02:00
lib treewide: replace interface{} with any 2025-04-07 10:51:05 +02:00
maildir reload: fix crash when reloading via IPC 2025-09-23 14:02:37 +02:00
mbox chore: switch to using stdlib helper functions 2025-08-04 12:47:05 +02:00
middleware foldermap: map directory in Messages{Moved,Copied} and RemoveDirectory 2025-03-30 21:31:28 +02:00
notmuch mod: update go-maildir 2025-05-25 19:05:07 +02:00
types worker: fix race condition 2025-09-23 14:09:25 +02:00
handler_notmuch.go format: reformat code with go 1.17 2021-12-11 23:24:08 +01:00
worker.go aerc: use single event loop 2022-10-07 10:51:53 +02:00
worker_enabled.go watchers: move filesystem monitoring stuff in lib 2023-08-04 11:32:40 +02:00