Skip to content

Commit

Permalink
fix: revert 'unstable' spin loop change
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptonemo committed Mar 18, 2021
1 parent a82b874 commit a82db80
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions storage-proofs-porep/src/stacked/vanilla/memory_handling.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::cell::UnsafeCell;
use std::fs::File;
use std::hint::spin_loop;
use std::marker::{PhantomData, Sync};
use std::mem::size_of;
use std::path::PathBuf;
use std::slice;
use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering};
use std::sync::atomic::{spin_loop_hint, AtomicU64, AtomicUsize, Ordering};

use anyhow::Result;
use byte_slice_cast::{AsSliceOf, FromByteSlice};
Expand Down Expand Up @@ -73,7 +72,7 @@ impl IncrementingCursor {
// We successfully incremented `self.cur`, so we are responsible for advancing the resource.
{
while wait_fn() {
spin_loop()
spin_loop_hint()
}
}

Expand All @@ -85,7 +84,7 @@ impl IncrementingCursor {
// We failed to increment `self.cur_window`, so we must wait for the window to be advanced before
// continuing. Wait until it is safe to use the new current window.
while self.cur_safe.load(Ordering::SeqCst) != cur + 1 {
spin_loop()
spin_loop_hint()
}
}
}
Expand Down

0 comments on commit a82db80

Please sign in to comment.