aboutsummaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorMatthew Taylor <mstaveleytaylor@gmail.com>2017-07-01 04:46:24 +0100
committercjihrig <cjihrig@gmail.com>2017-07-12 09:42:44 -0400
commitbdc87005a17ce843e0efca8938aa8c190aa91a38 (patch)
tree6a494e319929e6ac8d8083ee5f7a5a59bddec727 /docs/src
parentad1c828827043fd1048582cee60103a68c8d929a (diff)
downloadlibuv-bdc87005a17ce843e0efca8938aa8c190aa91a38.tar.gz
libuv-bdc87005a17ce843e0efca8938aa8c190aa91a38.zip
doc: add thread safety warning for process title
Add a small warning about uv_get_process_title() and uv_set_process_title() not being thread safe on platforms other than Windows. Also add a reminder for users to call uv_setup_args() first. Fixes: https://github.com/libuv/libuv/issues/1395 PR-URL: https://github.com/libuv/libuv/pull/1396 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/misc.rst23
1 files changed, 15 insertions, 8 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst
index 9d7c3617..3fea708a 100644
--- a/docs/src/misc.rst
+++ b/docs/src/misc.rst
@@ -186,17 +186,24 @@ API
.. c:function:: int uv_get_process_title(char* buffer, size_t size)
- Gets the title of the current process. If `buffer` is `NULL` or `size` is
- zero, `UV_EINVAL` is returned. If `size` cannot accommodate the process
- title and terminating `NULL` character, the function returns `UV_ENOBUFS`.
+ Gets the title of the current process. You *must* call `uv_setup_args`
+ before calling this function. If `buffer` is `NULL` or `size` is zero,
+ `UV_EINVAL` is returned. If `size` cannot accommodate the process title and
+ terminating `NULL` character, the function returns `UV_ENOBUFS`.
+
+ .. warning::
+ `uv_get_process_title` is not thread safe on any platform except Windows.
.. c:function:: int uv_set_process_title(const char* title)
- Sets the current process title. On platforms with a fixed size buffer for the
- process title the contents of `title` will be copied to the buffer and
- truncated if larger than the available space. Other platforms will return
- `UV_ENOMEM` if they cannot allocate enough space to duplicate the contents of
- `title`.
+ Sets the current process title. You *must* call `uv_setup_args` before
+ calling this function. On platforms with a fixed size buffer for the process
+ title the contents of `title` will be copied to the buffer and truncated if
+ larger than the available space. Other platforms will return `UV_ENOMEM` if
+ they cannot allocate enough space to duplicate the contents of `title`.
+
+ .. warning::
+ `uv_set_process_title` is not thread safe on any platform except Windows.
.. c:function:: int uv_resident_set_memory(size_t* rss)