Bug 1438892 - Update rayon usage in webrender_bindings for version bump in WR PR 2431. r?jrmuizel draft
authorGlenn Watson <github@intuitionlibrary.com>
Tue, 20 Feb 2018 09:05:38 -0500
changeset 757250 de8f2d2f2a3503bba9ed610fc626c091f54d2d73
parent 757249 eb423d5dd95c4ef75ad78139b3019cd93d832bc1
child 757251 3545fa3c2eaca65653ab3b7bb98d98b4e44f7b26
push id99726
push userkgupta@mozilla.com
push dateTue, 20 Feb 2018 14:08:06 +0000
reviewersjrmuizel
bugs1438892
milestone60.0a1
Bug 1438892 - Update rayon usage in webrender_bindings for version bump in WR PR 2431. r?jrmuizel MozReview-Commit-ID: KBgSjM0ThKo
gfx/webrender_bindings/src/bindings.rs
--- 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);