Skip to content

Commit

Permalink
Making read_epoch AtomicU64
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulstrackx authored and mzohreva committed Aug 16, 2022
1 parent 65e3657 commit bacbda4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ipc-queue/src/fifo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ where
let arc = Arc::new(FifoBuffer::new(len));
let inner = Fifo::from_arc(arc);
let tx = AsyncSender { inner: inner.clone(), synchronizer: s.clone() };
let rx = AsyncReceiver { inner, synchronizer: s, read_epoch: Arc::new(AtomicU32::new(0)) };
let rx = AsyncReceiver { inner, synchronizer: s, read_epoch: Arc::new(AtomicU64::new(0)) };
(tx, rx)
}

Expand Down
6 changes: 3 additions & 3 deletions ipc-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use std::future::Future;
use std::pin::Pin;
use std::sync::atomic::AtomicU32;
use std::sync::atomic::AtomicU64;
use std::sync::Arc;

use fortanix_sgx_abi::FifoDescriptor;
Expand Down Expand Up @@ -154,7 +154,7 @@ pub struct AsyncSender<T: 'static, S> {
pub struct AsyncReceiver<T: 'static, S> {
inner: Fifo<T>,
synchronizer: S,
read_epoch: Arc<AtomicU32>,
read_epoch: Arc<AtomicU64>,
}

/// `DescriptorGuard<T>` can produce a `FifoDescriptor<T>` that is guaranteed
Expand All @@ -177,7 +177,7 @@ impl<T> DescriptorGuard<T> {
/// read to/from the queue. This is useful in case we want to know whether or
/// not a particular value written to the queue has been read.
pub struct PositionMonitor<T: 'static> {
read_epoch: Arc<AtomicU32>,
read_epoch: Arc<AtomicU64>,
fifo: Fifo<T>,
}

Expand Down

0 comments on commit bacbda4

Please sign in to comment.