File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -659,6 +659,28 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
659659 ]
660660)
661661
662+ TEMP_LDFLAGS="$LDFLAGS"
663+ LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS"
664+ AC_MSG_CHECKING ( [ for thread_local support] )
665+ AC_LINK_IFELSE ( [ AC_LANG_SOURCE ( [
666+ #include <thread>
667+ static thread_local int foo = 0;
668+ static void run_thread() { foo++;}
669+ int main(){
670+ for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();}
671+ return foo;
672+ }
673+ ] ) ] ,
674+ [
675+ AC_DEFINE ( HAVE_THREAD_LOCAL ,1 ,[ Define if thread_local is supported.] )
676+ AC_MSG_RESULT ( yes )
677+ ] ,
678+ [
679+ AC_MSG_RESULT ( no )
680+ ]
681+ )
682+ LDFLAGS="$TEMP_LDFLAGS"
683+
662684# Check for different ways of gathering OS randomness
663685AC_MSG_CHECKING ( for Linux getrandom syscall )
664686AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <unistd.h>
Original file line number Diff line number Diff line change 1111#include < stdio.h>
1212
1313#ifdef DEBUG_LOCKCONTENTION
14+ #if !defined(HAVE_THREAD_LOCAL)
15+ static_assert (false , " thread_local is not supported" );
16+ #endif
1417void PrintLockContention (const char * pszName, const char * pszFile, int nLine)
1518{
1619 LogPrintf (" LOCKCONTENTION: %s\n " , pszName);
You can’t perform that action at this time.
0 commit comments