forked from M-Labs/libfringe
implement Send where applicable
This commit is contained in:
parent
7271fe1724
commit
519d86ca4c
@ -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")]
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user