Skip to content

Commit ead1f93

Browse files
committed
zephyr: Remove work-queue executor
The work-queue-based executor was an attempt to implement a Rust executor that worked with Zephyr work queues. Although it was possible to make something that kind of worked, and did have the advantage of being able to use a few Zephyr primitives, it suffers from several problems: - It isn't very efficient, basically combining the overhead of async scheduling, triggered work, and the Zephyr thread scheduler. - It plays poorly with any other use of async. Since it is useful to be able to use external crates for async utilities, this normally just results in undefined-behavior. Now that we have another executor (built from Embassy), this code is also mostly unneeded. Signed-off-by: David Brown <[email protected]>
1 parent e250d5b commit ead1f93

File tree

10 files changed

+14
-1302
lines changed

10 files changed

+14
-1302
lines changed

zephyr/src/kio.rs

-183
This file was deleted.

zephyr/src/kio/sync.rs

-125
This file was deleted.

zephyr/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ pub mod align;
8080
pub mod device;
8181
pub mod embassy;
8282
pub mod error;
83-
#[cfg(CONFIG_RUST_ALLOC)]
84-
pub mod kio;
8583
pub mod logging;
8684
pub mod object;
8785
#[cfg(CONFIG_RUST_ALLOC)]

zephyr/src/sync.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ impl<T> PinWeak<T> {
4848
/// This would be easier to use if it could be added to Arc.
4949
pub fn downgrade(this: Pin<Arc<T>>) -> Self {
5050
// SAFETY: we will never return anything other than a Pin<Arc<T>>.
51-
Self(Arc::downgrade(& unsafe { Pin::into_inner_unchecked(this) }))
51+
Self(Arc::downgrade(&unsafe { Pin::into_inner_unchecked(this) }))
5252
}
5353

5454
/// Upgrade back to a `Pin<Arc<T>>`.
5555
pub fn upgrade(&self) -> Option<Pin<Arc<T>>> {
5656
// SAFETY: The weak was only constructed from a `Pin<Arc<T>>`.
57-
self.0.upgrade().map(|arc| unsafe { Pin::new_unchecked(arc) })
57+
self.0
58+
.upgrade()
59+
.map(|arc| unsafe { Pin::new_unchecked(arc) })
5860
}
5961
}
6062

0 commit comments

Comments
 (0)