Commit 8a7e23d
authored
Make
Changes made:
- Use 0 for the thread ID to ensure it's always valid. The function
expects `0 <= tid < jl_n_threads` so 1 is incorrect if `jl_n_threads` is
1.
- After retrieving the affinity mask with `jl_getaffinity`, pass that
same mask back to `jl_setaffinity`. This ensures that the mask is always
valid. Using a mask of all ones results in `EINVAL` on FreeBSD. Based on
the discussion in #53402, this change may also fix Windows, so I've
tried reenabling it here.
- To check whether `jl_getaffinity` actually did something, we can check
that the mask is no longer all zeros after the call.
Fixes #54817jl_*affinity tests more portable (#55261)1 parent cdd599c commit 8a7e23d
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
| 360 | + | |
362 | 361 | | |
363 | 362 | | |
364 | | - | |
365 | | - | |
366 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
0 commit comments