]> git.sesse.net Git - stockfish/blobdiff - src/thread.h
Use thread_local compiler specifics
[stockfish] / src / thread.h
index c39c6e695e9fc7947a9b3a89fb7aad655c61e5d9..e03578eef8db488c34e23fde3a95157fbd8102f1 100644 (file)
@@ -120,8 +120,6 @@ public:
   int min_split_depth() const { return minimumSplitDepth; }
   int size() const { return (int)threads.size(); }
   Thread* main_thread() const { return threads[0]; }
-  Thread* this_thread() const { return (Thread*)tls_get(tlsKey); }
-  void set_this_thread(Thread* th) const { tls_set(tlsKey, th); }
 
   void wake_up() const;
   void sleep() const;
@@ -140,7 +138,6 @@ private:
 
   std::vector<Thread*> threads;
   Thread* timer;
-  ThreadLocalStorageKey tlsKey;
   Lock splitLock;
   WaitCondition sleepCond;
   Depth minimumSplitDepth;
@@ -149,5 +146,6 @@ private:
 };
 
 extern ThreadsManager Threads;
+extern THREAD_LOCAL Thread* this_thread;
 
 #endif // !defined(THREAD_H_INCLUDED)