tls: wrap reference to a mutex into an #if !SDL_THREADS_DISABLED test.
diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c
index 438612c..1f13ce4 100644
--- a/src/thread/SDL_thread.c
+++ b/src/thread/SDL_thread.c
@@ -141,10 +141,10 @@ SDL_Generic_GetTLSData(void)
}
SDL_AtomicUnlock(&tls_lock);
}
-#endif /* SDL_THREADS_DISABLED */
-
SDL_MemoryBarrierAcquire();
SDL_LockMutex(SDL_generic_TLS_mutex);
+#endif /* SDL_THREADS_DISABLED */
+
for (entry = SDL_generic_TLS; entry; entry = entry->next) {
if (entry->thread == thread) {
storage = entry->storage;