Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod zalsa;
mod zalsa_local;

#[cfg(feature = "rayon")]
pub use parallel::{join, par_map, scope, Scope};
pub use parallel::{join, par_map};
#[cfg(feature = "macros")]
pub use salsa_macros::{accumulator, db, input, interned, tracked, Supertype, Update};

Expand Down
33 changes: 0 additions & 33 deletions src/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,6 @@ impl Clone for DbForkOnClone {
}
}

pub struct Scope<'scope, 'local, Db: Database + ?Sized> {
db: &'local Db,
base: &'local rayon::Scope<'scope>,
}

impl<'scope, 'local, Db: Database + ?Sized> Scope<'scope, 'local, Db> {
pub fn spawn<BODY>(&self, body: BODY)
where
BODY: for<'l> FnOnce(&'l Scope<'scope, 'l, Db>) + Send + 'scope,
{
let db = self.db.fork_db();
self.base.spawn(move |scope| {
let scope = Scope {
db: db.as_view::<Db>(),
base: scope,
};
body(&scope)
})
}

pub fn db(&self) -> &'local Db {
self.db
}
}

pub fn scope<'scope, Db: Database + ?Sized, OP, R>(db: &Db, op: OP) -> R
where
OP: FnOnce(&Scope<'scope, '_, Db>) -> R + Send,
R: Send,
{
rayon::in_place_scope(move |s| op(&Scope { db, base: s }))
}

pub fn join<A, B, RA, RB, Db: Database + ?Sized>(db: &Db, a: A, b: B) -> (RA, RB)
where
A: FnOnce(&Db) -> RA + Send,
Expand Down
1 change: 0 additions & 1 deletion tests/parallel/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ mod cycle_panic;
mod parallel_cancellation;
mod parallel_join;
mod parallel_map;
mod parallel_scope;
mod signal;
114 changes: 0 additions & 114 deletions tests/parallel/parallel_scope.rs

This file was deleted.