pub fn with_device<R>(dev: usize, f: impl FnOnce() -> R) -> R
Run f with this thread pinned to dev, restoring the previous pin.
f
dev