diff --git a/src/runtime2/component/component_random.rs b/src/runtime2/component/component_random.rs index 07bb9bbee0bdedaaa31cd3339b942d37b71ac007..d493f00a294c4ad9d274aca600a7120f8a1126e3 100644 --- a/src/runtime2/component/component_random.rs +++ b/src/runtime2/component/component_random.rs @@ -83,8 +83,9 @@ impl Component for ComponentRandomU32 { } else { sched_ctx.log("Entering sync mode"); self.did_perform_send = false; - self.consensus.notify_sync_start(comp_ctx); - self.exec_state.mode = CompMode::Sync; + component::default_handle_sync_start( + &mut self.exec_state, &mut [], sched_ctx, comp_ctx, &mut self.consensus + ); } return CompScheduling::Immediate; @@ -120,10 +121,7 @@ impl Component for ComponentRandomU32 { } } else { // Message was sent, finish this sync round - sched_ctx.log("Waiting for consensus"); - self.exec_state.mode = CompMode::SyncEnd; - let decision = self.consensus.notify_sync_end_success(sched_ctx, comp_ctx); - component::default_handle_sync_decision(sched_ctx, &mut self.exec_state, comp_ctx, decision, &mut self.consensus); + component::default_handle_sync_end(&mut self.exec_state, sched_ctx, comp_ctx, &mut self.consensus); return CompScheduling::Requeue; } },