mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
LibThread: Add API to join a thread
This commit is contained in:
parent
3ac0c9b9e7
commit
d51173e4c4
2 changed files with 6 additions and 0 deletions
|
@ -64,6 +64,11 @@ void LibThread::Thread::start()
|
||||||
dbg() << "Started a thread, tid = " << m_tid;
|
dbg() << "Started a thread, tid = " << m_tid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LibThread::Thread::join()
|
||||||
|
{
|
||||||
|
pthread_join(m_tid, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
void LibThread::Thread::quit(void* code)
|
void LibThread::Thread::quit(void* code)
|
||||||
{
|
{
|
||||||
ASSERT(m_tid == pthread_self());
|
ASSERT(m_tid == pthread_self());
|
||||||
|
|
|
@ -41,6 +41,7 @@ public:
|
||||||
virtual ~Thread();
|
virtual ~Thread();
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
|
void join();
|
||||||
void quit(void* code = 0);
|
void quit(void* code = 0);
|
||||||
pthread_t tid() const { return m_tid; }
|
pthread_t tid() const { return m_tid; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue