Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5da1f0c

Browse filesBrowse files
bzoztargos
authored andcommitted
doc, win: improve os.setPriority documentation
PR-URL: #22817 Fixes: #22799 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 6ed5845 commit 5da1f0c
Copy full SHA for 5da1f0c

File tree

Expand file treeCollapse file tree

2 files changed

+6
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/os.md‎

Copy file name to clipboardExpand all lines: doc/api/os.md
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ priority classes, `priority` is mapped to one of six priority constants in
371371
mapping may cause the return value to be slightly different on Windows. To avoid
372372
confusion, it is recommended to set `priority` to one of the priority constants.
373373

374+
On Windows setting priority to `PRIORITY_HIGHEST` requires elevated user,
375+
otherwise the set priority will be silently reduced to `PRIORITY_HIGH`.
376+
374377
## os.tmpdir()
375378
<!-- YAML
376379
added: v0.9.9
Collapse file

‎test/parallel/test-os-process-priority.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-os-process-priority.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ function checkPriority(pid, expected) {
116116
return;
117117
}
118118

119+
// On Windows setting PRIORITY_HIGHEST will only work for elevated user,
120+
// for others it will be silently reduced to PRIORITY_HIGH
119121
if (expected < PRIORITY_HIGH)
120-
assert.strictEqual(priority, PRIORITY_HIGHEST);
122+
assert.ok(priority === PRIORITY_HIGHEST || priority === PRIORITY_HIGH);
121123
else if (expected < PRIORITY_ABOVE_NORMAL)
122124
assert.strictEqual(priority, PRIORITY_HIGH);
123125
else if (expected < PRIORITY_NORMAL)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.