Skip to content

Commit dd38774

Browse files
authored
Merge pull request #250 from jcelerier/patch-1
Add an escape hatch when thread-local is not supported
2 parents e6fec43 + c4b814c commit dd38774

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

concurrentqueue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ namespace moodycamel { namespace details {
104104
static const thread_id_t invalid_thread_id2 = 0xFFFFFFFFU; // Not technically guaranteed to be invalid, but is never used in practice. Note that all Win32 thread IDs are presently multiples of 4.
105105
static inline thread_id_t thread_id() { return static_cast<thread_id_t>(::GetCurrentThreadId()); }
106106
} }
107-
#elif defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || (defined(__APPLE__) && TARGET_OS_IPHONE)
107+
#elif defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || (defined(__APPLE__) && TARGET_OS_IPHONE) || defined(MOODYCAMEL_NO_THREAD_LOCAL)
108108
namespace moodycamel { namespace details {
109109
static_assert(sizeof(std::thread::id) == 4 || sizeof(std::thread::id) == 8, "std::thread::id is expected to be either 4 or 8 bytes");
110110

0 commit comments

Comments
 (0)