-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thread_setaffinity: Allow affinity param to have a length less than c…
…pumask_size() Instead of enforcing that the table length is >= cpumask_size(), any missing CPU numbers get assigned an affinity of `false`. This makes this API a bit more user-friendly, since users no longer have to initialize a table of length `cpumask_size()` before setting the particular affinities they actually want. As an example, before this commit, you'd have to do something like: local affinity = {} for i=1,uv.cpumask_size() do affinity[i] = false end affinity[3] = true affinity[5] = true But after this commit, this table: local affinity = { [3] = true, [5] = true } will now be accepted and all the missing keys up to `uv_cpumask_size()` will be treated as `false` in the `thread_setaffinity` call.
- Loading branch information
Showing
3 changed files
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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