summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2020-01-09 15:21:14 +0000
committerTim Rühsen <tim.ruehsen@gmx.de>2020-01-09 15:21:14 +0000
commit2e52d307be9f971c721a94a908f487df5e8e483b (patch)
tree646e154c4a21eb588028408b88a9a202b3cfb643
parent16802c66b835c1b4050f2f999995ea1bd3e7a1af (diff)
parent5c11b5998a27f9d2b1ea1d9a207165628913c3b8 (diff)
downloadgnutls-2e52d307be9f971c721a94a908f487df5e8e483b.tar.gz
Merge branch 'tmp-fix-doc' into 'master'
doc: clarify thread safeness in gnutls_global_init() [ci skip] Closes #900 See merge request gnutls/gnutls!1162
-rw-r--r--doc/cha-gtls-app.texi4
-rw-r--r--lib/global.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/doc/cha-gtls-app.texi b/doc/cha-gtls-app.texi
index 74fed786b7..969aa5c86f 100644
--- a/doc/cha-gtls-app.texi
+++ b/doc/cha-gtls-app.texi
@@ -364,7 +364,9 @@ The GnuTLS library is initialized on load; prior to 3.3.0 was initialized by cal
The original behavior of requiring explicit initialization can obtained by setting the
GNUTLS_NO_EXPLICIT_INIT environment variable to 1, or by using the macro GNUTLS_SKIP_GLOBAL_INIT
in a global section of your program --the latter works in systems with
-support for weak symbols only.}.
+support for weak symbols only.}. @funcref{gnutls_global_init} in
+versions after 3.3.0 is thread-safe (see @ref{Thread safety}).
+
The initialization typically enables CPU-specific acceleration, performs any required
precalculations needed, opens any required system devices (e.g., /dev/urandom on Linux)
and initializes subsystems that could be used later.
diff --git a/lib/global.c b/lib/global.c
index 334148342e..b42fcb2632 100644
--- a/lib/global.c
+++ b/lib/global.c
@@ -211,7 +211,7 @@ static int _gnutls_init_ret = 0;
* called as many times as gnutls_global_init(). This is useful when
* GnuTLS is used by more than one library in an application. This
* function can be called many times, but will only do something the
- * first time.
+ * first time. It is thread safe since GnuTLS 3.3.0.
*
* A subsequent call of this function if the initial has failed will
* return the same error code.