Bug 1438892 - Update rayon usage in webrender_bindings for version bump in WR PR 2431. r?jrmuizel
MozReview-Commit-ID: KBgSjM0ThKo
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -667,28 +667,29 @@ impl ThreadListener for GeckoProfilerThr
}
}
}
pub struct WrThreadPool(Arc<rayon::ThreadPool>);
#[no_mangle]
pub unsafe extern "C" fn wr_thread_pool_new() -> *mut WrThreadPool {
- let worker_config = rayon::Configuration::new()
+ let worker = rayon::ThreadPoolBuilder::new()
.thread_name(|idx|{ format!("WRWorker#{}", idx) })
.start_handler(|idx| {
let name = format!("WRWorker#{}", idx);
register_thread_with_profiler(name.clone());
gecko_profiler_register_thread(CString::new(name).unwrap().as_ptr());
})
.exit_handler(|_idx| {
gecko_profiler_unregister_thread();
- });
+ })
+ .build();
- let workers = Arc::new(rayon::ThreadPool::new(worker_config).unwrap());
+ let workers = Arc::new(worker.unwrap());
Box::into_raw(Box::new(WrThreadPool(workers)))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_thread_pool_delete(thread_pool: *mut WrThreadPool) {
Box::from_raw(thread_pool);