Add missing dyn for cloudabi, redox, unix and wasm
This commit is contained in:
@@ -32,7 +32,7 @@ unsafe impl Send for Thread {}
|
|||||||
unsafe impl Sync for Thread {}
|
unsafe impl Sync for Thread {}
|
||||||
|
|
||||||
impl Thread {
|
impl Thread {
|
||||||
pub unsafe fn new<'a>(stack: usize, p: Box<FnBox() + 'a>) -> io::Result<Thread> {
|
pub unsafe fn new<'a>(stack: usize, p: Box<dyn FnBox() + 'a>) -> io::Result<Thread> {
|
||||||
let p = box p;
|
let p = box p;
|
||||||
let mut native: libc::pthread_t = mem::zeroed();
|
let mut native: libc::pthread_t = mem::zeroed();
|
||||||
let mut attr: libc::pthread_attr_t = mem::zeroed();
|
let mut attr: libc::pthread_attr_t = mem::zeroed();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ unsafe impl Send for Thread {}
|
|||||||
unsafe impl Sync for Thread {}
|
unsafe impl Sync for Thread {}
|
||||||
|
|
||||||
impl Thread {
|
impl Thread {
|
||||||
pub unsafe fn new<'a>(_stack: usize, p: Box<FnBox() + 'a>) -> io::Result<Thread> {
|
pub unsafe fn new<'a>(_stack: usize, p: Box<dyn FnBox() + 'a>) -> io::Result<Thread> {
|
||||||
let p = box p;
|
let p = box p;
|
||||||
|
|
||||||
let id = cvt(syscall::clone(syscall::CLONE_VM | syscall::CLONE_FS | syscall::CLONE_FILES))?;
|
let id = cvt(syscall::clone(syscall::CLONE_VM | syscall::CLONE_FS | syscall::CLONE_FILES))?;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ pub struct Command {
|
|||||||
uid: Option<uid_t>,
|
uid: Option<uid_t>,
|
||||||
gid: Option<gid_t>,
|
gid: Option<gid_t>,
|
||||||
saw_nul: bool,
|
saw_nul: bool,
|
||||||
closures: Vec<Box<FnMut() -> io::Result<()> + Send + Sync>>,
|
closures: Vec<Box<dyn FnMut() -> io::Result<()> + Send + Sync>>,
|
||||||
stdin: Option<Stdio>,
|
stdin: Option<Stdio>,
|
||||||
stdout: Option<Stdio>,
|
stdout: Option<Stdio>,
|
||||||
stderr: Option<Stdio>,
|
stderr: Option<Stdio>,
|
||||||
@@ -155,12 +155,12 @@ impl Command {
|
|||||||
self.gid
|
self.gid
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_closures(&mut self) -> &mut Vec<Box<FnMut() -> io::Result<()> + Send + Sync>> {
|
pub fn get_closures(&mut self) -> &mut Vec<Box<dyn FnMut() -> io::Result<()> + Send + Sync>> {
|
||||||
&mut self.closures
|
&mut self.closures
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn before_exec(&mut self,
|
pub fn before_exec(&mut self,
|
||||||
f: Box<FnMut() -> io::Result<()> + Send + Sync>) {
|
f: Box<dyn FnMut() -> io::Result<()> + Send + Sync>) {
|
||||||
self.closures.push(f);
|
self.closures.push(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ unsafe fn pthread_attr_setstacksize(_attr: *mut libc::pthread_attr_t,
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Thread {
|
impl Thread {
|
||||||
pub unsafe fn new<'a>(stack: usize, p: Box<FnBox() + 'a>)
|
pub unsafe fn new<'a>(stack: usize, p: Box<dyn FnBox() + 'a>)
|
||||||
-> io::Result<Thread> {
|
-> io::Result<Thread> {
|
||||||
let p = box p;
|
let p = box p;
|
||||||
let mut native: libc::pthread_t = mem::zeroed();
|
let mut native: libc::pthread_t = mem::zeroed();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ pub struct Thread(Void);
|
|||||||
pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
|
pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
|
||||||
|
|
||||||
impl Thread {
|
impl Thread {
|
||||||
pub unsafe fn new<'a>(_stack: usize, _p: Box<FnBox() + 'a>)
|
pub unsafe fn new<'a>(_stack: usize, _p: Box<dyn FnBox() + 'a>)
|
||||||
-> io::Result<Thread>
|
-> io::Result<Thread>
|
||||||
{
|
{
|
||||||
unsupported()
|
unsupported()
|
||||||
|
|||||||
Reference in New Issue
Block a user