mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +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
Notes:
sideshowbarker
2024-07-19 09:38:09 +09:00
Author: https://github.com/jcs
Commit: 482611766a
Pull-request: https://github.com/SerenityOS/serenity/pull/1177
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