Skip to content

Commit 188ca75

Browse files
committed
disable HAVE_THREAD_LOCAL on unreliable platforms
Note that this doesn't affect anything unless DEBUG_LOCKCONTENTION is defined. See discussions here: - bitcoin/bitcoin#11722 (review) - bitcoin/bitcoin#13168 (comment)
1 parent 89e8df1 commit 188ca75

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

configure.ac

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,23 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
827827
}
828828
])],
829829
[
830-
AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])
831-
AC_MSG_RESULT(yes)
830+
case $host in
831+
*mingw*)
832+
# mingw32's implementation of thread_local has also been shown to behave
833+
# erroneously under concurrent usage; see:
834+
# https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605
835+
AC_MSG_RESULT(no)
836+
;;
837+
*darwin*)
838+
# TODO enable thread_local on later versions of Darwin where it is
839+
# supported (per https://stackoverflow.com/a/29929949)
840+
AC_MSG_RESULT(no)
841+
;;
842+
*)
843+
AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])
844+
AC_MSG_RESULT(yes)
845+
;;
846+
esac
832847
],
833848
[
834849
AC_MSG_RESULT(no)

0 commit comments

Comments
 (0)