File tree 3 files changed +18
-7
lines changed
3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 29
29
/* *************************************************************************/
30
30
31
31
#include " platform_config.h"
32
- #ifndef PLATFORM_THREAD_OVERRIDE // See details in thread.h
32
+
33
+ #ifndef PLATFORM_THREAD_OVERRIDE // See details in thread.h.
33
34
34
35
#include " thread.h"
35
36
36
37
#ifdef THREADS_ENABLED
37
38
#include " core/object/script_language.h"
38
- #include " core/templates/safe_refcount.h"
39
39
40
40
SafeNumeric<uint64_t > Thread::id_counter (1 ); // The first value after .increment() is 2, hence by default the main thread ID should be 1.
41
41
Original file line number Diff line number Diff line change 29
29
/* *************************************************************************/
30
30
31
31
#include " platform_config.h"
32
+
32
33
// Define PLATFORM_THREAD_OVERRIDE in your platform's `platform_config.h`
33
- // to use a custom Thread implementation defined in `platform/[your_platform]/platform_thread.h`
34
- // Overriding the platform implementation is required in some proprietary platforms
34
+ // to use a custom Thread implementation defined in `platform/[your_platform]/platform_thread.h`.
35
+ // Overriding the Thread implementation is required in some proprietary platforms.
36
+
35
37
#ifdef PLATFORM_THREAD_OVERRIDE
38
+
36
39
#include " platform_thread.h"
40
+
37
41
#else
38
42
39
43
#ifndef THREAD_H
40
44
#define THREAD_H
41
45
42
- #include " core/templates/safe_refcount.h"
43
46
#include " core/typedefs.h"
44
47
48
+ #ifdef THREADS_ENABLED
49
+
50
+ #include " core/templates/safe_refcount.h"
51
+
52
+ #include < new> // IWYU pragma: keep // For hardware interference size.
53
+
45
54
#ifdef MINGW_ENABLED
46
55
#define MINGW_STDTHREAD_REDUNDANCY_WARNING
47
56
#include " thirdparty/mingw-std-threads/mingw.thread.h"
53
62
54
63
class String ;
55
64
56
- #ifdef THREADS_ENABLED
57
-
58
65
class Thread {
59
66
public:
60
67
typedef void (*Callback)(void *p_userdata);
@@ -143,6 +150,8 @@ class Thread {
143
150
144
151
#else // No threads.
145
152
153
+ class String ;
154
+
146
155
class Thread {
147
156
public:
148
157
typedef void (*Callback)(void *p_userdata);
Original file line number Diff line number Diff line change 31
31
#ifndef THREAD_SAFE_H
32
32
#define THREAD_SAFE_H
33
33
34
+ #include "core/os/mutex.h" // IWYU pragma: keep // Used in macro.
35
+
34
36
#define _THREAD_SAFE_CLASS_ mutable Mutex _thread_safe_;
35
37
#define _THREAD_SAFE_METHOD_ MutexLock _thread_safe_method_(_thread_safe_);
36
38
#define _THREAD_SAFE_LOCK_ _thread_safe_.lock();
You can’t perform that action at this time.
0 commit comments