Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl PartialOrd for IoAddress {
/// real concurrent multiple threads handling. For device backend drivers not
/// focusing on high performance, they may use the Mutex<T: DeviceIoMut>
/// adapter to simplify implementation.
pub trait DeviceIo: Send {
pub trait DeviceIo: Send + Sync {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense for this to be Sync, but (just wondering, like the previous question) does anything depend on it being Send as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The the DeviceIo needs to be Send + Sync for Arc to be Sync:)

/// Read from the guest physical address `base`, starting at `offset`.
/// Result is placed in `data`.
fn read(&self, base: IoAddress, offset: IoAddress, data: &mut [u8]);
Expand Down