diff options
author | cjihrig <cjihrig@gmail.com> | 2018-08-12 21:59:22 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-08-15 09:17:55 -0400 |
commit | e57e07172eba9df2f8fa0cec051cac0c5cac9124 (patch) | |
tree | 3169c2b284dffa1b90afecaf37add1d3e0f5f817 /docs/src | |
parent | 7284adfa7a833264fc67d68d39610da27ecbab7c (diff) | |
download | libuv-e57e07172eba9df2f8fa0cec051cac0c5cac9124.tar.gz libuv-e57e07172eba9df2f8fa0cec051cac0c5cac9124.zip |
unix,win: add uv_os_{get,set}priority()
Refs: https://github.com/nodejs/node/pull/21675
PR-URL: https://github.com/libuv/libuv/pull/1945
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/misc.rst | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst index 07908c98..529d588c 100644 --- a/docs/src/misc.rst +++ b/docs/src/misc.rst @@ -517,3 +517,31 @@ API storage required to hold the value. .. versionadded:: 1.12.0 + +.. c:function:: int uv_os_getpriority(uv_pid_t pid, int* priority) + + Retrieves the scheduling priority of the process specified by `pid`. The + returned value of `priority` is between -20 (high priority) and 19 (low + priority). + + .. note:: + On Windows, the returned priority will equal one of the `UV_PRIORITY` + constants. + + .. versionadded:: 1.23.0 + +.. c:function:: int uv_os_setpriority(uv_pid_t pid, int priority) + + Sets the scheduling priority of the process specified by `pid`. The + `priority` value range is between -20 (high priority) and 19 (low priority). + The constants `UV_PRIORITY_LOW`, `UV_PRIORITY_BELOW_NORMAL`, + `UV_PRIORITY_NORMAL`, `UV_PRIORITY_ABOVE_NORMAL`, `UV_PRIORITY_HIGH`, and + `UV_PRIORITY_HIGHEST` are also provided for convenience. + + .. note:: + On Windows, this function utilizes `SetPriorityClass()`. The `priority` + argument is mapped to a Windows priority class. When retrieving the + process priority, the result will equal one of the `UV_PRIORITY` + constants, and not necessarily the exact value of `priority`. + + .. versionadded:: 1.23.0 |