diff options
author | 2020-10-23 20:52:58 +0000 | |
---|---|---|
committer | 2020-10-23 20:52:58 +0000 | |
commit | bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b (patch) | |
tree | c70a80e9bcacb54838f09141bd1d2b27e844760f /macros/src/codegen/resources.rs | |
parent | b3aa9e99a975eca637582f31de20fe11ae8f7d64 (diff) | |
parent | e8eca4be37a2fe1af25b203ace5e99b31fcc3972 (diff) | |
download | rtic-bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b.tar.gz rtic-bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b.tar.zst rtic-bbcae14e37c5f4ab5701b2a688bee52bfa7aaa1b.zip |
Merge #399
399: Now all locks are symmetric r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'macros/src/codegen/resources.rs')
-rw-r--r-- | macros/src/codegen/resources.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/macros/src/codegen/resources.rs b/macros/src/codegen/resources.rs index 0db4f728..76871e59 100644 --- a/macros/src/codegen/resources.rs +++ b/macros/src/codegen/resources.rs @@ -49,7 +49,8 @@ pub fn codegen( )); } - if let Some(Ownership::Contended { ceiling }) = analysis.ownerships.get(name) { + let r_prop = &res.properties; + if !r_prop.task_local && !r_prop.lock_free { mod_resources.push(quote!( #[allow(non_camel_case_types)] #(#cfgs)* @@ -83,13 +84,20 @@ pub fn codegen( ) }; + let ceiling = match analysis.ownerships.get(name) { + Some(Ownership::Owned { priority }) => *priority, + Some(Ownership::CoOwned { priority }) => *priority, + Some(Ownership::Contended { ceiling }) => *ceiling, + None => 0, + }; + mod_app.push(util::impl_mutex( extra, cfgs, true, name, quote!(#ty), - *ceiling, + ceiling, ptr, )); } |