various fixes and updates for satrs-core

1. Fix pools integration test to avoid occasional deadlocks
2. tmtc module: The `CcsdsPacketHandler` and `PusServiceProvider`
   do not require a send bound anymore. However, these traits now
   have an extension trait called `Sendable<DefaultName>` which requires
   the trait + Send. A blanket implementation is provided. The helper
   structs like `PusDistributor` and `CcsdsDistributor` require
   the new Sendable trait version to allow more ergnomic usage
   with threads.
This commit is contained in:
2023-01-27 00:04:56 +01:00
parent 4e361e4421
commit 40120dc83f
4 changed files with 38 additions and 15 deletions

View File

@ -20,14 +20,15 @@ fn threaded_usage() {
});
let jh1 = thread::spawn(move || {
let mut pool_access = shared_clone.write().unwrap();
let addr;
{
addr = rx.recv().expect("Receiving store address failed");
let mut pool_access = shared_clone.write().unwrap();
let pg = PoolGuard::new(pool_access.deref_mut(), addr);
let read_res = pg.read().expect("Reading failed");
assert_eq!(read_res, DUMMY_DATA);
}
let pool_access = shared_clone.read().unwrap();
assert!(!pool_access.has_element_at(&addr).expect("Invalid address"));
});
jh0.join().unwrap();