Conversation
qile222
requested changes
Nov 9, 2018
src/js/os.js
Outdated
| if (typeof priority !== 'number') { | ||
| throw new TypeError('priority must be a number'); | ||
| } | ||
| if (priority > 19) { |
Contributor
There was a problem hiding this comment.
use UV_PRIORITY_LOW and UV_PRIORITY_HIGHST defined from UV instead of literal ?
Member
Author
There was a problem hiding this comment.
Actually those defines are for using at Windows, I still leave those on uv.h is to acquire consistence.
Contributor
There was a problem hiding this comment.
seems those defines are using at Linux too, see setPriority doc
Member
Author
There was a problem hiding this comment.
Could you please reference the code/lines in details? Can not search any that defines from your link :(
234f5fd to
c9bebab
Compare
Member
Author
|
The CI seems green now, @lolBig @legendecas please see again :) |
legendecas
reviewed
Dec 3, 2018
src/js/os.js
Outdated
| if (priority > 19) { | ||
| priority = 19; | ||
| } else if (priority < -20) { | ||
| priority = -20; |
Contributor
There was a problem hiding this comment.
Should an error been thrown instead of silently rounded?
3691731 to
ec663da
Compare
legendecas
approved these changes
Dec 3, 2018
qile222
reviewed
Dec 3, 2018
src/js/os.js
Outdated
| if (priority > constants.UV_PRIORITY_LOW || | ||
| priority < constants.UV_PRIORITY_HIGHEST) { | ||
| throw new RangeError( | ||
| 'The value of "priority" is out of range. It must be > -20 && < 19.'); |
Contributor
There was a problem hiding this comment.
use constants instead of -20 or 19
qile222
approved these changes
Dec 3, 2018
qile222
pushed a commit
that referenced
this pull request
Dec 13, 2018
* master: (35 commits) https: client request doesn’t define default encoding (#440) n-api: data pointer was NULL on getting typed array info (#441) os: build bcast address interface. (#439) assert: better deepStrictEqual assertion (#435) working on v0.11.x (#434) process: memory leaks on recursive ticking (#433) uv, os: implement os.{get,set}Priority functions (#409) jerry: implement ES2015 class feature (part II.) (#428) test: fix wrong travis diff target introduced by #425 (#429) jerry: pass and enable jerry-test-suite (#425) n-api: ArrayBuffer/TypedArray support (#419) deps: upgrade the mbedtls to 2.13.0-apache (#384) jerry: rework jerry_parse function (#422) jerry: finalize hint of array buffers (#421) jerry: reduce the argument count of ecma_op_object_get_property_names (#424) n-api: update headers/test suites to LTS(10.13.0) (#416) jerry: Date.now shall return an integer (#418) n-api: thread safe functions (#411) util: IOTJS_ASSERT prints stack trace on macOS (#415) process: set immediate shall start an idle handle to activate uv_loop (#417) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements the following APIs:
With the group of APIs, we are able to tweak the priority level on demand at runtime.
Checklist
npm testpasses