Skip to content

Commit 85500a7

Browse files
committed
Tsan test fix
1 parent 5f26f63 commit 85500a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/tsan.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fn unchecked() {
166166

167167
let mut rb: spsc::Queue<u8, N> = spsc::Queue::new();
168168

169-
for _ in 0..N / 2 {
169+
for _ in 0..N / 2 - 1 {
170170
rb.enqueue(1).unwrap();
171171
}
172172

@@ -175,24 +175,24 @@ fn unchecked() {
175175

176176
Pool::new(2).scoped(move |scope| {
177177
scope.execute(move || {
178-
for _ in 0..N / 2 {
178+
for _ in 0..N / 2 - 1 {
179179
p.enqueue(2).unwrap();
180180
}
181181
});
182182

183183
scope.execute(move || {
184184
let mut sum: usize = 0;
185185

186-
for _ in 0..N / 2 {
186+
for _ in 0..N / 2 - 1 {
187187
sum = sum.wrapping_add(usize::from(c.dequeue().unwrap()));
188188
}
189189

190-
assert_eq!(sum, N / 2);
190+
assert_eq!(sum, N / 2 - 1);
191191
});
192192
});
193193
}
194194

195-
assert_eq!(rb.len(), N / 2);
195+
assert_eq!(rb.len(), N / 2 - 1);
196196
}
197197

198198
#[test]

0 commit comments

Comments
 (0)