mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
LibCore: Remove CThread
It's been replaced with Thread::Thread.
This commit is contained in:
parent
7c92f7d537
commit
0826cc5a35
3 changed files with 0 additions and 57 deletions
|
@ -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 = \
|
OBJS = \
|
||||||
CArgsParser.o \
|
CArgsParser.o \
|
||||||
CIODevice.o \
|
CIODevice.o \
|
||||||
CThread.o \
|
|
||||||
CFile.o \
|
CFile.o \
|
||||||
CSocket.o \
|
CSocket.o \
|
||||||
CLocalSocket.o \
|
CLocalSocket.o \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue