doc, win: improve os.setPriority documentation
PR-URL: https://github.com/nodejs/node/pull/22817 Fixes: https://github.com/nodejs/node/issues/22799 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Родитель
6ed58457e2
Коммит
5da1f0ca2c
|
@ -371,6 +371,9 @@ priority classes, `priority` is mapped to one of six priority constants in
|
|||
mapping may cause the return value to be slightly different on Windows. To avoid
|
||||
confusion, it is recommended to set `priority` to one of the priority constants.
|
||||
|
||||
On Windows setting priority to `PRIORITY_HIGHEST` requires elevated user,
|
||||
otherwise the set priority will be silently reduced to `PRIORITY_HIGH`.
|
||||
|
||||
## os.tmpdir()
|
||||
<!-- YAML
|
||||
added: v0.9.9
|
||||
|
|
|
@ -116,8 +116,10 @@ function checkPriority(pid, expected) {
|
|||
return;
|
||||
}
|
||||
|
||||
// On Windows setting PRIORITY_HIGHEST will only work for elevated user,
|
||||
// for others it will be silently reduced to PRIORITY_HIGH
|
||||
if (expected < PRIORITY_HIGH)
|
||||
assert.strictEqual(priority, PRIORITY_HIGHEST);
|
||||
assert.ok(priority === PRIORITY_HIGHEST || priority === PRIORITY_HIGH);
|
||||
else if (expected < PRIORITY_ABOVE_NORMAL)
|
||||
assert.strictEqual(priority, PRIORITY_HIGH);
|
||||
else if (expected < PRIORITY_NORMAL)
|
||||
|
|
Загрузка…
Ссылка в новой задаче