aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2018-05-21 13:44:23 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2019-04-26 13:46:07 -0400
commit188ca75e5fe4837d16241446558c7566912f67b2 (patch)
tree427a1f376adb5e0eba1b7fc3bbe7b861894afb3a /configure.ac
parent89e8df167432101ed1b9251a8ebf30fe0d4daa45 (diff)
disable HAVE_THREAD_LOCAL on unreliable platforms
Note that this doesn't affect anything unless DEBUG_LOCKCONTENTION is defined. See discussions here: - https://github.com/bitcoin/bitcoin/pull/11722#pullrequestreview-79322658 - https://github.com/bitcoin/bitcoin/pull/13168#issuecomment-387181155
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 17 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index a3ba8ce808..302fc639d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -827,8 +827,23 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
}
])],
[
- AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])
- AC_MSG_RESULT(yes)
+ case $host in
+ *mingw*)
+ # mingw32's implementation of thread_local has also been shown to behave
+ # erroneously under concurrent usage; see:
+ # https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605
+ AC_MSG_RESULT(no)
+ ;;
+ *darwin*)
+ # TODO enable thread_local on later versions of Darwin where it is
+ # supported (per https://stackoverflow.com/a/29929949)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])
+ AC_MSG_RESULT(yes)
+ ;;
+ esac
],
[
AC_MSG_RESULT(no)