diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-01-31 15:24:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-31 15:24:56 +0100 |
commit | 5525cd85c60455b0bb9716bbef0ad2ad8111d752 (patch) | |
tree | 52ff0e2d3e01dd2655feff1cf88f07e10d84aad1 /drivers/unix/thread_posix.h | |
parent | 02eb11450b4151b02db861b5029783e52e16c603 (diff) | |
parent | 99fe462452be44efa618e83ad9bbecd722ae6ecd (diff) | |
download | redot-engine-5525cd85c60455b0bb9716bbef0ad2ad8111d752.tar.gz |
Merge pull request #45315 from RandomShaper/modernize_thread
Modernize Thread
Diffstat (limited to 'drivers/unix/thread_posix.h')
-rw-r--r-- | drivers/unix/thread_posix.h | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/drivers/unix/thread_posix.h b/drivers/unix/thread_posix.h index fa2037e1a2..8b8a736bf0 100644 --- a/drivers/unix/thread_posix.h +++ b/drivers/unix/thread_posix.h @@ -31,42 +31,8 @@ #ifndef THREAD_POSIX_H #define THREAD_POSIX_H -#if (defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)) && !defined(NO_THREADS) - -#include "core/os/thread.h" -#include <pthread.h> -#include <sys/types.h> - -class ThreadPosix : public Thread { - static pthread_key_t thread_id_key; - static ID next_thread_id; - - pthread_t pthread; - pthread_attr_t pthread_attr; - ThreadCreateCallback callback; - void *user; - ID id; - - static Thread *create_thread_posix(); - - static void *thread_callback(void *userdata); - - static Thread *create_func_posix(ThreadCreateCallback p_callback, void *, const Settings &); - static ID get_thread_id_func_posix(); - static void wait_to_finish_func_posix(Thread *p_thread); - - static Error set_name_func_posix(const String &p_name); - - ThreadPosix(); - -public: - virtual ID get_id() const; - - static void make_default(); - - ~ThreadPosix(); -}; - +#if !defined(NO_THREADS) +void init_thread_posix(); #endif #endif |