Skip to content

Commit

Permalink
redesigned the pinning to pin deal with things on dequeue, not on enq…
Browse files Browse the repository at this point in the history
…ueue
  • Loading branch information
toddaaro committed Jun 14, 2013
1 parent 4224fc7 commit d1ec8b5
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 213 deletions.
11 changes: 0 additions & 11 deletions src/libstd/macros.rs
Expand Up @@ -49,18 +49,7 @@ pub fn do_abort() -> ! {
macro_rules! abort(
($( $msg:expr),+) => ( {
rtdebug!($($msg),+);

// do_abort();

// NB: This is in a fn to avoid putting the `unsafe` block in
// a macro, which causes spurious 'unnecessary unsafe block'
// warnings.
// fn do_abort() -> ! {
// unsafe { ::libc::abort(); }
// }

::macros::do_abort();

} )
)

6 changes: 3 additions & 3 deletions src/libstd/rt/local.rs
Expand Up @@ -30,7 +30,7 @@ impl Local for Scheduler {
fn borrow<T>(f: &fn(&mut Scheduler) -> T) -> T {
let mut res: Option<T> = None;
let res_ptr: *mut Option<T> = &mut res;
unsafe {
unsafe {
do local_ptr::borrow |sched| {
let result = f(sched);
*res_ptr = Some(result);
Expand All @@ -39,7 +39,7 @@ impl Local for Scheduler {
match res {
Some(r) => { r }
None => abort!("function failed!")
}
}
}
unsafe fn unsafe_borrow() -> *mut Scheduler { local_ptr::unsafe_borrow() }
unsafe fn try_unsafe_borrow() -> Option<*mut Scheduler> { abort!("unimpl") }
Expand Down Expand Up @@ -139,5 +139,5 @@ mod test {
assert!(res)
let _scheduler: ~Scheduler = Local::take();
}

}

0 comments on commit d1ec8b5

Please sign in to comment.