23 #include <drizzled/internal/my_sys.h>
24 #include <drizzled/internal/thread_var.h>
25 #include <drizzled/internal/m_string.h>
30 #if TIME_WITH_SYS_TIME
31 # include <sys/time.h>
35 # include <sys/time.h>
41 #include <boost/thread/thread.hpp>
42 #include <boost/thread/mutex.hpp>
43 #include <boost/thread/tss.hpp>
48 thread_local_st THR_KEY_mysys;
49 boost::mutex THR_LOCK_threads;
51 static uint64_t thread_id= 0;
67 if (THR_KEY_mysys.get())
71 boost::mutex::scoped_lock scopedLock(THR_LOCK_threads);
72 THR_KEY_mysys.reset(
new st_my_thread_var(++thread_id));
75 thread_local_st& my_thread_var2()
TODO: Rename this file - func.h is stupid.