Skip to content

Commit 13910d4

Browse files
committed
Add sync::spawn
1 parent fbb9396 commit 13910d4

File tree

1 file changed

+5
-1
lines changed
  • src/librustc_data_structures

1 file changed

+5
-1
lines changed

src/librustc_data_structures/sync.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ cfg_if! {
199199
f(&SerialScope)
200200
}
201201

202+
pub fn spawn(f: impl FnOnce() + 'static) {
203+
f()
204+
}
205+
202206
#[macro_export]
203207
macro_rules! parallel {
204208
($($blocks:tt),*) => {
@@ -385,7 +389,7 @@ cfg_if! {
385389

386390
use std;
387391
use std::thread;
388-
pub use rayon::{join, scope};
392+
pub use rayon::{join, scope, spawn};
389393

390394
/// Runs a list of blocks in parallel. The first block is executed immediately on
391395
/// the current thread. Use that for the longest running block.

0 commit comments

Comments
 (0)