From 4e5cfa7cfc2bc1cd2fbcc419027df687f124d4d0 Mon Sep 17 00:00:00 2001 From: Sergii Parubochyi Date: Wed, 22 Nov 2023 18:41:35 +1100 Subject: Add mutex feature for std variant std Mutex has slightly different interface, that would require do `.lock().unwrap()` where as `spin::Mutex` just requires `.lock()`. This makes rather complicated to maintain `no_std` version along with dylib with std. Having same Mutex interface available make it easier to use and makes sense. Test: mm Change-Id: I196d9767cef5161347487c0b4f71f527d5e36683 --- Android.bp | 4 ++++ cargo_embargo.json | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Android.bp b/Android.bp index bf50beb..86265a2 100644 --- a/Android.bp +++ b/Android.bp @@ -40,7 +40,9 @@ rust_library { srcs: ["src/lib.rs"], edition: "2015", features: [ + "mutex", "once", + "spin_mutex", "std", ], apex_available: [ @@ -66,7 +68,9 @@ rust_test { }, edition: "2015", features: [ + "mutex", "once", + "spin_mutex", "std", ], rustlibs: ["libcriterion"], diff --git a/cargo_embargo.json b/cargo_embargo.json index d3b04d4..e32838b 100644 --- a/cargo_embargo.json +++ b/cargo_embargo.json @@ -5,6 +5,8 @@ { "features": [ "once", + "mutex", + "spin_mutex", "std" ], "tests": true -- cgit v1.2.3