]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libcurl-thread.3: Warn memory functions must be thread safe
authorJay Satiro <raysatiro@yahoo.com>
Fri, 31 Jul 2015 05:58:03 +0000 (01:58 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 31 Jul 2015 05:58:03 +0000 (01:58 -0400)
Bug: http://curl.haxx.se/mail/lib-2015-07/0149.html
Reported-by: Eric Ridge
docs/libcurl/curl_global_init_mem.3
docs/libcurl/libcurl-thread.3

index 9cddef7c3ce7e421cd950a4a1d19461596e9ae1c..491550e2270b0d7ea1d3c6e36c84e20991f4cf5d 100644 (file)
@@ -36,9 +36,9 @@ This function works exactly as \fIcurl_global_init(3)\fP with one addition: it
 allows the application to set callbacks to replace the otherwise used internal
 memory functions.
 
-This man page only adds documentation for the callbacks, see the
-\fIcurl_global_init(3)\fP man page for all the rest. When you use this
-function, all callback arguments must be set to valid function pointers.
+When you use this function, all callback arguments must be set to valid
+function pointers. \fBIf you are using libcurl with multiple threads the
+callback replacement functions must be thread safe.\fP
 
 The prototypes for the given callbacks should match these:
 .IP "void *malloc_callback(size_t size);"
@@ -51,6 +51,9 @@ To replace realloc()
 To replace strdup()
 .IP "void *calloc_callback(size_t nmemb, size_t size);"
 To replace calloc()
+.RE
+This function is otherwise the same as \fIcurl_global_init(3)\fP, please refer
+to that man page for documentation.
 .SH "CAUTION"
 Manipulating these gives considerable powers to the application to severely
 screw things up for libcurl. Take care!
index 745ce474e627f4741f5f4fd0e0df62cbb4fdee19..b16caa2e8280413d4432fa19147dcdd8793ee563 100644 (file)
@@ -101,9 +101,14 @@ are Linux, Solaris and Windows.
 
 \fBcurl_global_* functions.\fP These functions are not thread safe. If you are
 using libcurl with multiple threads it is especially important that before use
-you call \fIcurl_global_init(3)\fP to explicitly initialize the library and its
-dependents, rather than rely on the "lazy" fail-safe initialization that takes
-place the first time \fIcurl_easy_init(3)\fP is called. For an in-depth
-explanation refer to \fIlibcurl(3)\fP section \fBGLOBAL CONSTANTS\fP.
+you call \fIcurl_global_init(3)\fP or \fIcurl_global_init_mem(3)\fP to
+explicitly initialize the library and its dependents, rather than rely on the
+"lazy" fail-safe initialization that takes place the first time
+\fIcurl_easy_init(3)\fP is called. For an in-depth explanation refer to
+\fIlibcurl(3)\fP section \fBGLOBAL CONSTANTS\fP.
+
+\fBMemory functions.\fP These functions, provided either by your operating
+system or your own replacements, must be thread safe. You can use
+\fIcurl_global_init_mem(3)\fP to set your own replacement memory functions.
 
 \fICURLOPT_DNS_USE_GLOBAL_CACHE(3)\fP is not thread-safe.