Change sys::Thread::new to take the thread entry as Box<dyn FnBox() + 'static>̣

This commit is contained in:
Jethro Beekman
2018-11-30 10:39:12 +05:30
parent 6c03640646
commit c559216ad0
6 changed files with 29 additions and 8 deletions

View File

@@ -28,7 +28,8 @@ pub struct Thread {
}
impl Thread {
pub unsafe fn new<'a>(stack: usize, p: Box<dyn FnBox() + 'a>)
// unsafe: see thread::Builder::spawn_unchecked for safety requirements
pub unsafe fn new(stack: usize, p: Box<dyn FnBox()>)
-> io::Result<Thread> {
let p = box p;