File tree 2 files changed +25
-0
lines changed
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([
659
659
]
660
660
)
661
661
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
+
662
684
# Check for different ways of gathering OS randomness
663
685
AC_MSG_CHECKING ( for Linux getrandom syscall )
664
686
AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ #include <unistd.h>
Original file line number Diff line number Diff line change 11
11
#include < stdio.h>
12
12
13
13
#ifdef DEBUG_LOCKCONTENTION
14
+ #if !defined(HAVE_THREAD_LOCAL)
15
+ static_assert (false , " thread_local is not supported" );
16
+ #endif
14
17
void PrintLockContention (const char * pszName, const char * pszFile, int nLine)
15
18
{
16
19
LogPrintf (" LOCKCONTENTION: %s\n " , pszName);
You can’t perform that action at this time.
0 commit comments