tasks / idle have exclusive access to Threshold, but do not own the token

This commit is contained in:
Jorge Aparicio 2017-07-18 20:03:22 -05:00
parent a2b0c9e0d0
commit 97a7e38db7
10 changed files with 61 additions and 17 deletions

View file

@ -221,10 +221,10 @@ macro_rules! task {
#[allow(non_snake_case)]
#[no_mangle]
pub unsafe extern "C" fn $NAME() {
let f: fn($crate::Threshold, ::$NAME::Resources) = $body;
let f: fn(&mut $crate::Threshold, ::$NAME::Resources) = $body;
f(
$crate::Threshold::new(::$NAME::$NAME),
&mut $crate::Threshold::new(::$NAME::$NAME),
::$NAME::Resources::new(),
);
}
@ -240,7 +240,7 @@ macro_rules! task {
#[no_mangle]
pub unsafe extern "C" fn $NAME() {
let f: fn(
$crate::Threshold,
&mut $crate::Threshold,
&mut $local,
::$NAME::Resources,
) = $body;
@ -250,7 +250,7 @@ macro_rules! task {
};
f(
$crate::Threshold::new(::$NAME::$NAME),
&mut $crate::Threshold::new(::$NAME::$NAME),
&mut LOCAL,
::$NAME::Resources::new(),
);