1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 06:55:07 +00:00

LibThread: Introduce a new threading library

This library is meant to provide C++-style wrappers over lower
level APIs such as syscalls and pthread_* functions, as well as
utilities for easily running pieces of logic on different
threads.
This commit is contained in:
Sergey Bugaev 2019-08-25 18:55:56 +03:00 committed by Andreas Kling
parent d5f3487203
commit e1a6f8a27d
9 changed files with 211 additions and 3 deletions

View file

@ -0,0 +1,23 @@
#pragma once
#include <AK/Function.h>
#include <LibCore/CObject.h>
namespace LibThread {
class Thread final : public CObject {
C_OBJECT(Thread);
public:
explicit Thread(Function<int()> action);
virtual ~Thread();
void start();
void quit(int code = 0);
private:
Function<int()> m_action;
int m_tid { -1 };
};
}