From 76bd1c4c102cb7e753212a9a30dd651a184a0a15 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sun, 23 Oct 2016 18:28:35 -0600 Subject: impl Send for KEvent --- src/sys/event.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sys/event.rs b/src/sys/event.rs index d44963db..47d18389 100644 --- a/src/sys/event.rs +++ b/src/sys/event.rs @@ -191,6 +191,15 @@ pub fn kqueue() -> Result { Errno::result(res) } + +/* + * KEvent can't derive Send because on some operating systems, udata is defined + * as a void*. However, KEvent's public API always treats udata as a uintptr_t, + * which is safe to Send. + */ +unsafe impl Send for KEvent { +} + impl KEvent { pub fn new(ident: uintptr_t, filter: EventFilter, flags: EventFlag, fflags:FilterFlag, data: intptr_t, udata: uintptr_t) -> KEvent { -- cgit v1.2.3