mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
Kernel: Take WorkQueue item as reference instead of pointer in do_queue
This commit is contained in:
parent
1462211ccf
commit
bf16061142
Notes:
sideshowbarker
2024-07-17 11:38:42 +09:00
Author: https://github.com/supercomputer7
Commit: bf16061142
Pull-request: https://github.com/SerenityOS/serenity/pull/12969
Reviewed-by: https://github.com/bgianfo
2 changed files with 5 additions and 5 deletions
|
@ -47,10 +47,10 @@ UNMAP_AFTER_INIT WorkQueue::WorkQueue(StringView name)
|
|||
m_thread = thread.release_nonnull();
|
||||
}
|
||||
|
||||
void WorkQueue::do_queue(WorkItem* item)
|
||||
void WorkQueue::do_queue(WorkItem& item)
|
||||
{
|
||||
m_items.with([&](auto& items) {
|
||||
items.append(*item);
|
||||
items.append(item);
|
||||
});
|
||||
m_wait_queue.wake_one();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
if (free_data)
|
||||
free_data(data);
|
||||
};
|
||||
do_queue(item);
|
||||
do_queue(*item);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
if (!item)
|
||||
return Error::from_errno(ENOMEM);
|
||||
item->function = Function(function);
|
||||
do_queue(item);
|
||||
do_queue(*item);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ private:
|
|||
Function<void()> function;
|
||||
};
|
||||
|
||||
void do_queue(WorkItem*);
|
||||
void do_queue(WorkItem&);
|
||||
|
||||
RefPtr<Thread> m_thread;
|
||||
WaitQueue m_wait_queue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue