Add an explanatory comment to scoped_thread.

This commit is contained in:
Nicholas Nethercote 2020-07-07 13:10:19 +10:00
parent 0a7d2970e5
commit 1e8ec2db1d

View File

@ -102,6 +102,8 @@ impl Write for Sink {
}
}
/// Like a `thread::Builder::spawn` followed by a `join()`, but avoids the need
/// for `'static` bounds.
#[cfg(not(parallel_compiler))]
pub fn scoped_thread<F: FnOnce() -> R + Send, R: Send>(cfg: thread::Builder, f: F) -> R {
struct Ptr(*mut ());