mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 23:53:20 +00:00
24 lines
345 B
C
24 lines
345 B
C
![]() |
#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 };
|
||
|
};
|
||
|
|
||
|
}
|