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:
parent
b5fc1fcb46
commit
482611766a
2 changed files with 10 additions and 9 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue