summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibThread/Thread.cpp5
-rw-r--r--Libraries/LibThread/Thread.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibThread/Thread.cpp b/Libraries/LibThread/Thread.cpp
index 58db14bbed..658a5d1163 100644
--- a/Libraries/LibThread/Thread.cpp
+++ b/Libraries/LibThread/Thread.cpp
@@ -64,6 +64,11 @@ void LibThread::Thread::start()
dbg() << "Started a thread, tid = " << m_tid;
}
+void LibThread::Thread::join()
+{
+ pthread_join(m_tid, nullptr);
+}
+
void LibThread::Thread::quit(void* code)
{
ASSERT(m_tid == pthread_self());
diff --git a/Libraries/LibThread/Thread.h b/Libraries/LibThread/Thread.h
index 01e8388246..26ef07d35d 100644
--- a/Libraries/LibThread/Thread.h
+++ b/Libraries/LibThread/Thread.h
@@ -41,6 +41,7 @@ public:
virtual ~Thread();
void start();
+ void join();
void quit(void* code = 0);
pthread_t tid() const { return m_tid; }