|
@@ -29,19 +29,28 @@
|
|
|
/**************************************************************************/
|
|
|
|
|
|
#include "platform_config.h"
|
|
|
+
|
|
|
// Define PLATFORM_THREAD_OVERRIDE in your platform's `platform_config.h`
|
|
|
-// to use a custom Thread implementation defined in `platform/[your_platform]/platform_thread.h`
|
|
|
-// Overriding the platform implementation is required in some proprietary platforms
|
|
|
+// to use a custom Thread implementation defined in `platform/[your_platform]/platform_thread.h`.
|
|
|
+// Overriding the Thread implementation is required in some proprietary platforms.
|
|
|
+
|
|
|
#ifdef PLATFORM_THREAD_OVERRIDE
|
|
|
+
|
|
|
#include "platform_thread.h"
|
|
|
+
|
|
|
#else
|
|
|
|
|
|
#ifndef THREAD_H
|
|
|
#define THREAD_H
|
|
|
|
|
|
-#include "core/templates/safe_refcount.h"
|
|
|
#include "core/typedefs.h"
|
|
|
|
|
|
+#ifdef THREADS_ENABLED
|
|
|
+
|
|
|
+#include "core/templates/safe_refcount.h"
|
|
|
+
|
|
|
+#include <new> // IWYU pragma: keep // For hardware interference size.
|
|
|
+
|
|
|
#ifdef MINGW_ENABLED
|
|
|
#define MINGW_STDTHREAD_REDUNDANCY_WARNING
|
|
|
#include "thirdparty/mingw-std-threads/mingw.thread.h"
|
|
@@ -53,8 +62,6 @@
|
|
|
|
|
|
class String;
|
|
|
|
|
|
-#ifdef THREADS_ENABLED
|
|
|
-
|
|
|
class Thread {
|
|
|
public:
|
|
|
typedef void (*Callback)(void *p_userdata);
|
|
@@ -143,6 +150,8 @@ public:
|
|
|
|
|
|
#else // No threads.
|
|
|
|
|
|
+class String;
|
|
|
+
|
|
|
class Thread {
|
|
|
public:
|
|
|
typedef void (*Callback)(void *p_userdata);
|