Skip to content

Commit 852c7c8

Browse files
committed
Only join when ecx.release_clock is SOme
1 parent e245252 commit 852c7c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/shims/unix/linux/eventfd.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ use crate::{concurrency::VClock, *};
1010

1111
use self::shims::unix::fd::FileDescriptor;
1212

13-
// TODO: add comment on this
14-
// Size of u8 array to hold u64 value.
1513
const U64_ARRAY_SIZE: usize = mem::size_of::<u64>();
1614

1715
/// Maximum value that the eventfd counter can hold.
@@ -113,7 +111,9 @@ impl FileDescription for Event {
113111
match self.counter.checked_add(num) {
114112
Some(new_count @ 0..=MAX_COUNTER) => {
115113
// Synchronize with all prior `write` calls to this FD.
116-
self.clock.join(&ecx.release_clock().unwrap());
114+
if let Some(clock) = &ecx.release_clock() {
115+
self.clock.join(clock);
116+
}
117117
self.counter = new_count;
118118
}
119119
None | Some(u64::MAX) => {

0 commit comments

Comments
 (0)