diff options
author | joshua stein <jcs@jcs.org> | 2020-01-30 17:46:13 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-05 18:39:45 +0100 |
commit | 482611766a9f8bb8bea733c5cd872bdeee00ef80 (patch) | |
tree | 4521111909bf4126413623b3dae785dda0b4c2a1 /Libraries/LibThread/Thread.h | |
parent | b5fc1fcb46aed0aeb20e03e6379c926f965beefe (diff) | |
download | serenity-482611766a9f8bb8bea733c5cd872bdeee00ef80.zip |
LibThread: Store thread id as pthread_t, use pthread_self()
Serenity calls pthread_self() for gettid() anyway but this makes it
portable.
Diffstat (limited to 'Libraries/LibThread/Thread.h')
-rw-r--r-- | Libraries/LibThread/Thread.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Libraries/LibThread/Thread.h b/Libraries/LibThread/Thread.h index 474a17fa42..a89d543e29 100644 --- a/Libraries/LibThread/Thread.h +++ b/Libraries/LibThread/Thread.h @@ -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; }; |