diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-06 14:48:33 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-08 21:15:01 +0100 |
commit | 0eca049a9b3ca7440b4a4c00ab0ebe57cc3ff948 (patch) | |
tree | 221f2a847010f3aed5b85ad708e5edf32746b0db /docs/src | |
parent | 3908af563c9a6dd64238a8867f5a2864dd146a09 (diff) | |
download | libuv-0eca049a9b3ca7440b4a4c00ab0ebe57cc3ff948.tar.gz libuv-0eca049a9b3ca7440b4a4c00ab0ebe57cc3ff948.zip |
thread: allow specifying stack size for new thread
PR-URL: https://github.com/libuv/libuv/pull/2179
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/threading.rst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/src/threading.rst b/docs/src/threading.rst index 89bb4a6f..a5759a38 100644 --- a/docs/src/threading.rst +++ b/docs/src/threading.rst @@ -55,10 +55,39 @@ API Threads ^^^^^^^ +.. c:type:: uv_thread_options_t + + Options for spawning a new thread (passed to :c:func:`uv_thread_create_ex`). + + :: + + typedef struct uv_process_options_s { + enum { + UV_THREAD_NO_FLAGS = 0x00, + UV_THREAD_HAS_STACK_SIZE = 0x01 + } flags; + size_t stack_size; + } uv_process_options_t; + + More fields may be added to this struct at any time, so its exact + layout and size should not be relied upon. + + .. versionadded:: 1.26.0 + .. c:function:: int uv_thread_create(uv_thread_t* tid, uv_thread_cb entry, void* arg) .. versionchanged:: 1.4.1 returns a UV_E* error code on failure +.. c:function:: int uv_thread_create_ex(uv_thread_t* tid, const uv_thread_options_t* params, uv_thread_cb entry, void* arg) + + Like :c:func:`uv_thread_create`, but additionally specifies options for creating a new thread. + + If `UV_THREAD_HAS_STACK_SIZE` is set, `stack_size` specifies a stack size for the new thread. + `0` indicates that the default value should be used, i.e. behaves as if the flag was not set. + Other values will be rounded up to the nearest page boundary. + + .. versionadded:: 1.26.0 + .. c:function:: uv_thread_t uv_thread_self(void) .. c:function:: int uv_thread_join(uv_thread_t *tid) .. c:function:: int uv_thread_equal(const uv_thread_t* t1, const uv_thread_t* t2) |