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:
Bartosz Sosnowski 2018-09-12 11:07:00 +02:00 коммит произвёл Michaël Zasso
Родитель 6ed58457e2
Коммит 5da1f0ca2c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 770F7A9A5AE15600
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -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)