Skip to content

Commit d5e4d98

Browse files
committed
fix(runtime): attacher should be !Send & !Sync
1 parent 4fd2404 commit d5e4d98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compio-runtime/src/attacher.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::io;
21
#[cfg(unix)]
32
use std::os::fd::OwnedFd;
43
#[cfg(windows)]
54
use std::os::windows::prelude::{OwnedHandle, OwnedSocket};
65
#[cfg(feature = "once_cell_try")]
76
use std::sync::OnceLock;
7+
use std::{io, marker::PhantomData};
88

99
use compio_buf::IntoInner;
1010
use compio_driver::AsRawFd;
@@ -24,6 +24,7 @@ pub struct Attacher<S> {
2424
source: S,
2525
// Make it thread safe.
2626
once: OnceLock<usize>,
27+
_p: PhantomData<*mut ()>,
2728
}
2829

2930
impl<S> Attacher<S> {
@@ -32,6 +33,7 @@ impl<S> Attacher<S> {
3233
Self {
3334
source,
3435
once: OnceLock::new(),
36+
_p: PhantomData,
3537
}
3638
}
3739
}
@@ -120,6 +122,7 @@ impl<S: TryClone + AsRawFd> TryClone for Attacher<S> {
120122
Self {
121123
source,
122124
once: self.once.clone(),
125+
_p: PhantomData,
123126
}
124127
} else {
125128
let new_self = Self::new(source);

0 commit comments

Comments
 (0)