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

Method SetResult

src/algorithm/commitctx.cpp:102–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102void CommitCtx :: SetResult(
103 const int iCommitRet,
104 const uint64_t llInstanceID,
105 const std::string & sLearnValue)
106{
107 m_oSerialLock.Lock();
108
109 if (m_bIsCommitEnd || (m_llInstanceID != llInstanceID))
110 {
111 m_oSerialLock.UnLock();
112 return;
113 }
114
115 m_iCommitRet = iCommitRet;
116
117 if (m_iCommitRet == 0)
118 {
119 if ((*m_psValue) != sLearnValue)
120 {
121 m_iCommitRet = PaxosTryCommitRet_Conflict;
122 }
123 }
124
125 m_bIsCommitEnd = true;
126 m_psValue = nullptr;
127
128 m_oSerialLock.Interupt();
129 m_oSerialLock.UnLock();
130}
131
132
133int CommitCtx :: GetResult(uint64_t & llSuccInstanceID)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected