diff options
author | Alan Somers <asomers@gmail.com> | 2016-10-23 18:28:35 -0600 |
---|---|---|
committer | Paul Osborne <osbpau@gmail.com> | 2016-10-29 21:28:22 -0500 |
commit | 76bd1c4c102cb7e753212a9a30dd651a184a0a15 (patch) | |
tree | 9d37a8de22f252db5d5bdaa368b4e12ae26e917b | |
parent | ff4484d343dbd8f224d767b4499cc502c4c7f016 (diff) | |
download | nix-76bd1c4c102cb7e753212a9a30dd651a184a0a15.zip |
impl Send for KEvent
-rw-r--r-- | src/sys/event.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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<RawFd> { 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 { |