Skip to content

Commit 76bd1c4

Browse files
asomersposborne
authored andcommitted
impl Send for KEvent
1 parent ff4484d commit 76bd1c4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sys/event.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ pub fn kqueue() -> Result<RawFd> {
191191
Errno::result(res)
192192
}
193193

194+
195+
/*
196+
* KEvent can't derive Send because on some operating systems, udata is defined
197+
* as a void*. However, KEvent's public API always treats udata as a uintptr_t,
198+
* which is safe to Send.
199+
*/
200+
unsafe impl Send for KEvent {
201+
}
202+
194203
impl KEvent {
195204
pub fn new(ident: uintptr_t, filter: EventFilter, flags: EventFlag,
196205
fflags:FilterFlag, data: intptr_t, udata: uintptr_t) -> KEvent {

0 commit comments

Comments
 (0)