1
0
Fork 0

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>
// See the LICENSE file included in this distribution.
use core::prelude::*;
pub use self::imp::{Registers, STACK_ALIGN};
unsafe impl Send for Registers {}
mod common;
#[cfg(target_arch = "x86_64")]

View File

@ -13,6 +13,9 @@ pub struct Context<'a, Stack: stack::Stack> {
_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 {
#[inline]
pub unsafe fn new<F>(mut stack: Stack, f: F) -> Context<'a, Stack>

View File

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