mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
LibCore: Remove CThread
It's been replaced with Thread::Thread.
This commit is contained in:
parent
7c92f7d537
commit
0826cc5a35
Notes:
sideshowbarker
2024-07-19 12:30:54 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/0826cc5a356 Pull-request: https://github.com/SerenityOS/serenity/pull/486 Reviewed-by: https://github.com/awesomekling
@ -1,33 +0,0 @@
|
||||
#ifdef __serenity__
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <LibCore/CEventLoop.h>
|
||||
#include <LibCore/CThread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
CThread& CThread::main_thread()
|
||||
{
|
||||
static CThread* main_thread;
|
||||
if (!main_thread)
|
||||
main_thread = new CThread(MainThread);
|
||||
return *main_thread;
|
||||
}
|
||||
|
||||
CThread::CThread(MainThreadTag)
|
||||
: m_thread_id(0)
|
||||
{
|
||||
}
|
||||
|
||||
CThread::CThread(int (*entry)(void*), void* user_data)
|
||||
{
|
||||
ASSERT(entry);
|
||||
m_thread_id = create_thread(entry, user_data);
|
||||
}
|
||||
|
||||
CThread::~CThread()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __serenity__
|
||||
|
||||
class CThread {
|
||||
public:
|
||||
static CThread& main_thread();
|
||||
|
||||
CThread(int (*entry)(void*), void* user_data);
|
||||
~CThread();
|
||||
|
||||
bool is_main_thread() const { return m_thread_id == 0; }
|
||||
int thread_id() const { return m_thread_id; }
|
||||
|
||||
private:
|
||||
enum MainThreadTag { MainThread };
|
||||
explicit CThread(MainThreadTag);
|
||||
|
||||
int m_thread_id { -1 };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -3,7 +3,6 @@ include ../../Makefile.common
|
||||
OBJS = \
|
||||
CArgsParser.o \
|
||||
CIODevice.o \
|
||||
CThread.o \
|
||||
CFile.o \
|
||||
CSocket.o \
|
||||
CLocalSocket.o \
|
||||
|
Loading…
Reference in New Issue
Block a user