1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +00:00

LibThread: Store thread id as pthread_t, use pthread_self()

Serenity calls pthread_self() for gettid() anyway but this makes it
portable.
This commit is contained in:
joshua stein 2020-01-30 17:46:13 -06:00 committed by Andreas Kling
parent b5fc1fcb46
commit 482611766a
2 changed files with 10 additions and 9 deletions

View file

@ -29,6 +29,7 @@
#include <AK/Function.h>
#include <AK/String.h>
#include <LibCore/CObject.h>
#include <pthread.h>
namespace LibThread {
@ -40,11 +41,11 @@ public:
virtual ~Thread();
void start();
void quit(int code = 0);
void quit(void *code = 0);
private:
Function<int()> m_action;
int m_tid { -1 };
pthread_t m_tid;
String m_thread_name;
};