1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +00:00

LibThread: Move CLock to LibThread::Lock

And adapt all the code that uses it.
This commit is contained in:
Sergey Bugaev 2019-08-25 23:51:27 +03:00 committed by Andreas Kling
parent 0826cc5a35
commit 3439a479af
7 changed files with 42 additions and 34 deletions

View file

@ -1,9 +1,9 @@
#include <LibThread/BackgroundAction.h>
#include <LibThread/Thread.h>
#include <LibCore/CLock.h>
#include <LibThread/Lock.h>
#include <AK/Queue.h>
static CLockable<Queue<Function<void()>>>* s_all_actions;
static LibThread::Lockable<Queue<Function<void()>>>* s_all_actions;
static LibThread::Thread* s_background_thread;
static int background_thread_func()
@ -27,13 +27,13 @@ static int background_thread_func()
static void init()
{
s_all_actions = new CLockable<Queue<Function<void()>>>();
s_all_actions = new LibThread::Lockable<Queue<Function<void()>>>();
s_background_thread = new LibThread::Thread(background_thread_func);
s_background_thread->set_name("Background thread");
s_background_thread->start();
}
CLockable<Queue<Function<void()>>>& LibThread::BackgroundActionBase::all_actions()
LibThread::Lockable<Queue<Function<void()>>>& LibThread::BackgroundActionBase::all_actions()
{
if (s_all_actions == nullptr)
init();