GetSupportsTLS/SetSupportsTLS

This commit is contained in:
Glenn Maynard
2004-09-09 02:28:05 +00:00
parent 481cde47a3
commit 82a2c657fd
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -30,6 +30,9 @@
#endif #endif
#endif #endif
/* Assume TLS doesn't work until told otherwise. It's ArchHooks's job to set this. */
bool RageThread::m_bSystemSupportsTLS = false;
#define MAX_THREADS 128 #define MAX_THREADS 128
//static vector<RageMutex*> *g_MutexList = NULL; /* watch out for static initialization order problems */ //static vector<RageMutex*> *g_MutexList = NULL; /* watch out for static initialization order problems */
+9
View File
@@ -7,6 +7,8 @@ class RageThread
ThreadSlot *m_pSlot; ThreadSlot *m_pSlot;
CString name; CString name;
static bool m_bSystemSupportsTLS;
public: public:
RageThread(); RageThread();
~RageThread(); ~RageThread();
@@ -28,6 +30,13 @@ public:
static bool EnumThreadIDs( int n, uint64_t &iID ); static bool EnumThreadIDs( int n, uint64_t &iID );
int Wait(); int Wait();
bool IsCreated() const { return m_pSlot != NULL; } bool IsCreated() const { return m_pSlot != NULL; }
/* A system can define HAVE_TLS, indicating that it can compile thread_local
* code, but an individual environment may not actually have functional TLS.
* If this returns false, thread_local variables are considered undefined. */
static bool GetSupportsTLS() { return m_bSystemSupportsTLS; }
static void SetSupportsTLS( bool b ) { m_bSystemSupportsTLS = b; }
}; };
namespace Checkpoints namespace Checkpoints