Set scheduler delegate during construction

Summary: I think it's possible that there's a race condition between creating the scheduler and setting the delegate leading to bugs like T47272192.

Reviewed By: mdvacca

Differential Revision: D16537737

fbshipit-source-id: 9c579537658be5a9aeed37c0e4935c997cabb6aa
This commit is contained in:
Joshua Gross
2019-07-29 10:42:31 -07:00
committed by Facebook Github Bot
parent 44be1f1516
commit 62591ac840
4 changed files with 8 additions and 6 deletions
@@ -229,8 +229,7 @@ void Binding::installFabricUIManager(
toolbox.runtimeExecutor = runtimeExecutor;
toolbox.synchronousEventBeatFactory = synchronousBeatFactory;
toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
scheduler_ = std::make_shared<Scheduler>(toolbox);
scheduler_->setDelegate(this);
scheduler_ = std::make_shared<Scheduler>(toolbox, this);
}
void Binding::uninstallFabricUIManager() {