implement Send where applicable

This commit is contained in:
edef 2015-04-16 07:06:30 -04:00
parent 7271fe1724
commit 519d86ca4c
3 changed files with 11 additions and 0 deletions

View File

@ -1,7 +1,10 @@
// Copyright (c) 2015, edef <edef@edef.eu> // Copyright (c) 2015, edef <edef@edef.eu>
// See the LICENSE file included in this distribution. // See the LICENSE file included in this distribution.
use core::prelude::*;
pub use self::imp::{Registers, STACK_ALIGN}; pub use self::imp::{Registers, STACK_ALIGN};
unsafe impl Send for Registers {}
mod common; mod common;
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]

View File

@ -13,6 +13,9 @@ pub struct Context<'a, Stack: stack::Stack> {
_ref: PhantomData<&'a ()> _ref: PhantomData<&'a ()>
} }
unsafe impl<'a, Stack> Send for Context<'a, Stack>
where Stack: stack::Stack + Send {}
impl<'a, Stack> Context<'a, Stack> where Stack: stack::Stack { impl<'a, Stack> Context<'a, Stack> where Stack: stack::Stack {
#[inline] #[inline]
pub unsafe fn new<F>(mut stack: Stack, f: F) -> Context<'a, Stack> pub unsafe fn new<F>(mut stack: Stack, f: F) -> Context<'a, Stack>

View File

@ -8,6 +8,9 @@ mod sys;
pub struct StackSource; pub struct StackSource;
unsafe impl Send for StackSource {}
unsafe impl Sync for StackSource {}
#[allow(raw_pointer_derive)] #[allow(raw_pointer_derive)]
#[derive(Debug)] #[derive(Debug)]
pub struct Stack { pub struct Stack {
@ -15,6 +18,8 @@ pub struct Stack {
len: usize len: usize
} }
unsafe impl Send for Stack {}
impl stack::StackSource for StackSource { impl stack::StackSource for StackSource {
type Output = Stack; type Output = Stack;
type Error = IoError; type Error = IoError;