aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2020-11-26 11:15:35 +0100
committerAram Drevekenin <aram@poor.dev>2020-11-26 11:15:35 +0100
commit4f2536a94df40fcd0d30605fb809507939de1a8b (patch)
tree5ceedf618ff09c25ff316fa9fae80fea2787fcd4 /src/tests
parentstyle(format): make rustfmt happy (diff)
downloadsl0ppij-4f2536a94df40fcd0d30605fb809507939de1a8b.tar.gz
sl0ppij-4f2536a94df40fcd0d30605fb809507939de1a8b.tar.xz
sl0ppij-4f2536a94df40fcd0d30605fb809507939de1a8b.zip
fix(tests): improve atomic data access
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/fakes.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/fakes.rs b/src/tests/fakes.rs
index c920d4d4..0afba192 100644
--- a/src/tests/fakes.rs
+++ b/src/tests/fakes.rs
@@ -46,7 +46,7 @@ impl FakeStdinReader {
impl Read for FakeStdinReader {
fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
loop {
- if self.started_reading_from_pty.load(Ordering::SeqCst) == false {
+ if self.started_reading_from_pty.load(Ordering::Acquire) == false {
::std::thread::sleep(MIN_TIME_BETWEEN_SNAPSHOTS);
} else {
let last_snapshot_time = { *self.last_snapshot_time.lock().unwrap() };
@@ -213,7 +213,7 @@ impl OsApi for FakeInputOutput {
// them fail
::std::thread::sleep(::std::time::Duration::from_millis(25));
} else if attempts_left == 0 {
- self.started_reading_from_pty.store(true, Ordering::SeqCst);
+ self.started_reading_from_pty.store(true, Ordering::Release);
return Ok(0);
}
let mut read_buffers = self.read_buffers.lock().unwrap();
@@ -227,7 +227,7 @@ impl OsApi for FakeInputOutput {
if bytes_read > bytes.read_position {
bytes.set_read_position(bytes_read);
}
- self.started_reading_from_pty.store(true, Ordering::SeqCst);
+ self.started_reading_from_pty.store(true, Ordering::Release);
return Ok(bytes_read);
}
None => {