1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

LibThreading: Add ability to cancel ongoing BackgroundActions

Handlers of the BackgroundAction are responsible for checking if the
action has been cancelled and returning early.
This commit is contained in:
Spencer Dixon 2021-07-02 10:34:19 -04:00 committed by Andreas Kling
parent 4a3958c8ae
commit 00f93b2545
4 changed files with 18 additions and 7 deletions

View file

@ -587,7 +587,7 @@ bool FileSystemModel::fetch_thumbnail_for(const Node& node)
auto weak_this = make_weak_ptr();
Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
[path] {
[path](auto&) {
return render_thumbnail(path);
},