MCPcopy Create free account
hub / github.com/Tencent/phxpaxos / run

Method run

src/algorithm/checkpoint_sender.cpp:81–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void CheckpointSender :: run()
82{
83 m_bIsStarted = true;
84 m_llAbsLastAckTime = Time::GetSteadyClockMS();
85
86 //pause checkpoint replayer
87 bool bNeedContinue = false;
88 while (!m_poCheckpointMgr->GetReplayer()->IsPaused())
89 {
90 if (m_bIsEnd)
91 {
92 m_bIsEnded = true;
93 return;
94 }
95
96 bNeedContinue = true;
97
98 m_poCheckpointMgr->GetReplayer()->Pause();
99 PLGDebug("wait replayer paused.");
100 Time::MsSleep(100);
101 }
102
103 int ret = LockCheckpoint();
104 if (ret == 0)
105 {
106 //send
107 SendCheckpoint();
108
109 UnLockCheckpoint();
110 }
111
112 //continue checkpoint replayer
113 if (bNeedContinue)
114 {
115 m_poCheckpointMgr->GetReplayer()->Continue();
116 }
117
118 PLGHead("Checkpoint.Sender [END]");
119 m_bIsEnded = true;
120}
121
122int CheckpointSender :: LockCheckpoint()
123{

Callers

nothing calls this directly

Calls 1

GetSteadyClockMSFunction · 0.50

Tested by

no test coverage detected