0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::json::stack: Add checkpoint ctor option for initial commitment state.

This commit is contained in:
Jason Volk 2019-03-30 14:06:18 -07:00
parent 9f534dea17
commit a9a6adf28d
2 changed files with 7 additions and 2 deletions

View file

@ -247,7 +247,7 @@ struct ircd::json::stack::checkpoint
bool recommit();
bool rollback();
checkpoint(stack &s);
checkpoint(stack &s, const bool &committed = true);
checkpoint(checkpoint &&) = delete;
checkpoint(const checkpoint &) = delete;
~checkpoint() noexcept;

View file

@ -1458,7 +1458,8 @@ ircd::json::stack::member::_post_append()
// stack::checkpoint
//
ircd::json::stack::checkpoint::checkpoint(stack &s)
ircd::json::stack::checkpoint::checkpoint(stack &s,
const bool &committed)
:s{&s}
,pc{s.cp}
,point
@ -1481,6 +1482,10 @@ ircd::json::stack::checkpoint::checkpoint(stack &s)
top.m->vc:
0;
}()}
,committed
{
committed
}
{
s.cp = this;
}