Change the state when the transaction gets returned in the pool. Simplifies debugging.
This commit is contained in:
parent
67a8bbfd1f
commit
3643b28116
@ -190,7 +190,11 @@ namespace cling {
|
||||
/// \}
|
||||
|
||||
State getState() const { return static_cast<State>(m_State); }
|
||||
void setState(State val) { m_State = val; }
|
||||
void setState(State val) {
|
||||
assert(m_State != kNumStates
|
||||
&& "Transaction already returned in the pool");
|
||||
m_State = val;
|
||||
}
|
||||
|
||||
IssuedDiags getIssuedDiags() const {
|
||||
return static_cast<IssuedDiags>(m_IssuedDiags);
|
||||
@ -368,6 +372,7 @@ namespace cling {
|
||||
|
||||
void printStructureBrief(size_t nindent = 0) const;
|
||||
|
||||
friend class TransactionPool;
|
||||
private:
|
||||
bool comesFromASTReader(clang::DeclGroupRef DGR) const;
|
||||
};
|
||||
|
@ -58,7 +58,9 @@ namespace cling {
|
||||
Transaction* takeTransaction() {
|
||||
if (m_Transactions.size() == 0)
|
||||
RefillPool();
|
||||
return m_Transactions.pop_back_val();
|
||||
Transaction* T = m_Transactions.pop_back_val();
|
||||
T->m_State = Transaction::kCollecting;
|
||||
return T;
|
||||
}
|
||||
|
||||
void releaseTransaction(Transaction* T) {
|
||||
@ -66,6 +68,7 @@ namespace cling {
|
||||
assert(T->getState() == Transaction::kCompleted
|
||||
&& "Transaction must completed!");
|
||||
T->reset();
|
||||
T->m_State = Transaction::kNumStates;
|
||||
m_Transactions.push_back(T);
|
||||
}
|
||||
#undef TRANSACTIONS_IN_BLOCK
|
||||
|
Loading…
x
Reference in New Issue
Block a user