Skip to content

Commit e08dea6

Browse files
committed
impl Send/Sync for VEXos files
1 parent 270ff62 commit e08dea6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/std/src/sys/fs/vexos.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ pub use unsupported_fs::{
1919
#[derive(Debug)]
2020
struct FileDesc(*mut vex_sdk::FIL);
2121

22+
// SAFETY: VEXos's FDs can be used on a thread other than the one they were created on.
23+
unsafe impl Send for FileDesc {}
24+
// SAFETY: We assume an environment without threads (i.e. no RTOS).
25+
// (If there were threads, it is possible that a mutex would be required.)
26+
unsafe impl Sync for FileDesc {}
27+
2228
pub struct File {
2329
fd: FileDesc,
2430
}

0 commit comments

Comments
 (0)