| 100 | } |
| 101 | |
| 102 | void 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 | |
| 133 | int CommitCtx :: GetResult(uint64_t & llSuccInstanceID) |
nothing calls this directly
no outgoing calls
no test coverage detected