Skip to content

Commit 88a1d77

Browse files
authored
Merge pull request #637 from Veykril/veykril/push-pqxwpkxprotm
Fix parallel_map::execute_cancellation test
2 parents c8d47cc + 87fdc13 commit 88a1d77

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tests/parallel/parallel_map.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ struct ParallelInput {
1515
fn tracked_fn(db: &dyn salsa::Database, input: ParallelInput) -> Vec<u32> {
1616
salsa::par_map(db, input.field(db), |_db, field| field + 1)
1717
}
18+
1819
#[salsa::tracked]
1920
fn a1(db: &dyn KnobsDatabase, input: ParallelInput) -> Vec<u32> {
2021
db.signal(1);
2122
salsa::par_map(db, input.field(db), |db, field| {
2223
db.wait_for(2);
23-
field + 1
24+
field + dummy(db)
2425
})
2526
}
2627

2728
#[salsa::tracked]
28-
fn dummy(_db: &dyn KnobsDatabase, _input: ParallelInput) -> ParallelInput {
29+
fn dummy(_db: &dyn KnobsDatabase) -> u32 {
2930
panic!("should never get here!")
3031
}
3132

tests/parallel/signal.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pub(crate) struct Signal {
88

99
impl Signal {
1010
pub(crate) fn signal(&self, stage: usize) {
11-
dbg!(format!("signal({})", stage));
12-
1311
// This check avoids acquiring the lock for things that will
1412
// clearly be a no-op. Not *necessary* but helps to ensure we
1513
// are more likely to encounter weird race conditions;
@@ -27,8 +25,6 @@ impl Signal {
2725
/// Waits until the given condition is true; the fn is invoked
2826
/// with the current stage.
2927
pub(crate) fn wait_for(&self, stage: usize) {
30-
dbg!(format!("wait_for({})", stage));
31-
3228
// As above, avoid lock if clearly a no-op.
3329
if stage > 0 {
3430
let mut v = self.value.lock();

0 commit comments

Comments
 (0)