Commit Graph

2 Commits

Author SHA1 Message Date
Zaggy1024
1c7aca7e07 LibThreading: Simplify BackgroundAction callback invocation
Using a Promise in BackgroundAction was not doing anything since the
change to use a weak reference to the event loop, so let's just drop
that.

The thread will now always move itself (and therefore its callbacks)
over to the originating thread before completing, regardless of the
presence of callbacks. This ensures that ref counting remains on the
main thread.

In addition, BackgroundAction's completion callback can no longer
return errors. This functionality wasn't actually used anywhere, it was
a holdover from the behavior of Core::Promise.
2026-03-02 17:06:39 -06:00
Jonathan Gamble
1e9f97a612 LibThreading: Run BackgroundAction error handlers on the origin loop
BEHAVIOR CHANGE: Don't call on_error if cancelled, just reject.
Don't reject promise from the background thread.
Prevent data race on cancelled flag.
2026-01-28 15:36:33 -06:00