-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is fs::Dir
not Sync
?
#1230
Comments
I think you're right; it could be |
It is |
nrath-js
added a commit
to nrath-js/rustix
that referenced
this issue
Dec 3, 2024
This is safe since all methods that mutate the internal state require a &mut self. It also makes behavior consistent with the linux_raw backend (whose `fs::Dir` is Sync+Send). Fixes: bytecodealliance#1230.
nrath-js
added a commit
to nrath-js/rustix
that referenced
this issue
Dec 3, 2024
This is safe since all methods that mutate the internal state require a &mut self. It also makes behavior consistent with the linux_raw backend (whose `fs::Dir` is Sync+Send). Fixes: bytecodealliance#1230.
sunfishcode
pushed a commit
that referenced
this issue
Dec 8, 2024
sunfishcode
pushed a commit
that referenced
this issue
Dec 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was surprised to see that the
fs::Dir
type is not marked asSync
.As far as I can tell, all methods that access the internal state require a
&mut self
, so I think it's fine to use this type from multiple threads without the need for another mutex (since at most one thread can hold a&mut
reference).Am I missing something?
The text was updated successfully, but these errors were encountered: