summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorThomas Guillem <thomas@gllm.fr>2022-04-05 15:46:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2022-06-07 13:34:03 +0200
commit23af112f5556d6a785c17e09f2422ac931405f61 (patch)
tree7da52fda05efd040e5df0c766c462a8020ec341e /m4
parent134963a5efdc3906257c88ce62dba8d46c292908 (diff)
downloadcurl-23af112f5556d6a785c17e09f2422ac931405f61.tar.gz
lib: make curl_global_init() threadsafe when possible
Use a posix pthread or a Windows SRWLOCK to lock curl_global_init*() and curl_global_cleanup(). Closes #8680
Diffstat (limited to 'm4')
-rw-r--r--m4/curl-functions.m423
1 files changed, 23 insertions, 0 deletions
diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4
index b40d42798..eb85dce4a 100644
--- a/m4/curl-functions.m4
+++ b/m4/curl-functions.m4
@@ -6566,3 +6566,26 @@ AC_DEFUN([CURL_COVERAGE],[
LIBS="$LIBS -lgcov"
fi
])
+
+dnl CURL_ATOMIC
+dnl --------------------------------------------------
+dnl Check if _Atomic works
+dnl
+AC_DEFUN([CURL_ATOMIC],[
+ AC_MSG_CHECKING([if _Atomic is available])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ $curl_includes_unistd
+ ]],[[
+ _Atomic int i = 0;
+ ]])
+ ],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE_UNQUOTED(HAVE_ATOMIC, 1,
+ [Define to 1 if you have _Atomic support.])
+ tst_atomic="yes"
+ ],[
+ AC_MSG_RESULT([no])
+ tst_atomic="no"
+ ])
+])