| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Sorry, just noticed that this is duplicated with #120175. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
ioctl_works in set_inheritable function is a static variable which has three possible values:
When it is 0, using ioctl as a fast path will always be skipped.
When it is -1 or 1, ioctl will be used as a fast path to perform the functionality, and it will be set to 0 or 1 based on the result of whether ioctl raises an error or not. And if ioctl failed, use fnctl as a slow path fallback.
Following this logic, it is safe to call set_inheritable with multiple threads in a free-threaded build. The fast path can be safely used even if it leads to failure. Therefore, we can simply use atomic operations to read or write ioctl_works's value to resolve data races.