Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/release-notes/iceoryx2-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
[#1321](https://github.com/eclipse-iceoryx/iceoryx2/issues/1321)
* Remove `posix` feature and use `cfg` switch based on target instead
[#1327](https://github.com/eclipse-iceoryx/iceoryx2/issues/1327)
* `CleanupState` implements `ZeroCopySend`
[#1331](https://github.com/eclipse-iceoryx/iceoryx2/issues/1331)

### Workflow

Expand Down
4 changes: 2 additions & 2 deletions iceoryx2-bb/lock-free/src/spsc/index_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ pub mod details {
#[repr(C)]
#[derive(Debug)]
pub struct IndexQueue<PointerType: PointerTrait<UnsafeCell<u64>>> {
data_ptr: PointerType,
capacity: usize,
write_position: AtomicU64,
read_position: AtomicU64,
pub(super) has_producer: AtomicBool,
pub(super) has_consumer: AtomicBool,
is_memory_initialized: AtomicBool,
capacity: usize,
data_ptr: PointerType,
}

unsafe impl<PointerType: PointerTrait<UnsafeCell<u64>>> Sync for IndexQueue<PointerType> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ pub mod details {
#[repr(C)]
pub struct SafelyOverflowingIndexQueue<PointerType: PointerTrait<UnsafeCell<u64>>> {
data_ptr: PointerType,
capacity: usize,
write_position: AtomicU64,
read_position: AtomicU64,
pub(super) has_producer: AtomicBool,
pub(super) has_consumer: AtomicBool,
is_memory_initialized: AtomicBool,
capacity: usize,
write_position: AtomicU64,
read_position: AtomicU64,
}

unsafe impl<PointerType: PointerTrait<UnsafeCell<u64>>> Sync
Expand Down
4 changes: 2 additions & 2 deletions iceoryx2-cal/src/zero_copy_connection/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ pub mod details {
#[derive(Debug)]
#[repr(C)]
struct Channel {
submission_queue: RelocatableSafelyOverflowingIndexQueue,
completion_queue: RelocatableIndexQueue,
state: AtomicU64,
completion_queue: RelocatableIndexQueue,
submission_queue: RelocatableSafelyOverflowingIndexQueue,
}

impl Channel {
Expand Down
4 changes: 2 additions & 2 deletions iceoryx2-ffi/python/src/cleanup_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ pub struct CleanupState(pub(crate) iceoryx2::node::CleanupState);
impl CleanupState {
#[getter]
/// The number of successful dead node cleanups
pub fn cleanups(&self) -> usize {
pub fn cleanups(&self) -> u64 {
self.0.cleanups
}

#[getter]
/// The number of failed dead node cleanups
pub fn failed_cleanups(&self) -> usize {
pub fn failed_cleanups(&self) -> u64 {
self.0.failed_cleanups
}
}
8 changes: 4 additions & 4 deletions iceoryx2/conformance-tests/src/node_death.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub mod node_death {
core::mem::forget(bad_publishers);
core::mem::forget(bad_subscribers);

assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES, failed_cleanups: 0});
assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES as _, failed_cleanups: 0});

for service in &services {
assert_that!(service.dynamic_config().number_of_publishers(), eq NUMBER_OF_PUBLISHERS - NUMBER_OF_BAD_NODES);
Expand Down Expand Up @@ -269,7 +269,7 @@ pub mod node_death {
core::mem::forget(bad_notifiers);
core::mem::forget(bad_listeners);

assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES, failed_cleanups: 0});
assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES as _, failed_cleanups: 0});

for service in &services {
assert_that!(service.dynamic_config().number_of_notifiers(), eq NUMBER_OF_NOTIFIERS - NUMBER_OF_BAD_NODES);
Expand Down Expand Up @@ -394,7 +394,7 @@ pub mod node_death {
core::mem::forget(bad_clients);
core::mem::forget(bad_servers);

assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES, failed_cleanups: 0});
assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES as _, failed_cleanups: 0});

for service in &services {
assert_that!(service.dynamic_config().number_of_clients(), eq NUMBER_OF_CLIENTS - NUMBER_OF_BAD_NODES);
Expand Down Expand Up @@ -475,7 +475,7 @@ pub mod node_death {

core::mem::forget(bad_readers);

assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES, failed_cleanups: 0});
assert_that!(Node::<S::Service>::cleanup_dead_nodes(&config), eq CleanupState { cleanups: NUMBER_OF_BAD_NODES as _, failed_cleanups: 0});

for service in &services {
assert_that!(service.dynamic_config().number_of_readers(), eq NUMBER_OF_READERS - NUMBER_OF_BAD_NODES);
Expand Down
7 changes: 4 additions & 3 deletions iceoryx2/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,13 @@ impl<Service: service::Service> NodeState<Service> {
/// could not be cleaned up.
/// This does not have to be an error, for instance when the current process does not
/// have the permission to access the corresponding resources.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, ZeroCopySend)]
#[repr(C)]
pub struct CleanupState {
/// The number of successful dead node cleanups
pub cleanups: usize,
pub cleanups: u64,
/// The number of failed dead node cleanups
pub failed_cleanups: usize,
pub failed_cleanups: u64,
}

/// Contains all available details of a [`Node`].
Expand Down
Loading