Branch data Line data Source code
1 : : #include <mutable/catalog/Scheduler.hpp> 2 : : 3 : : 4 : : using namespace m; 5 : : 6 : : 7 : : std::atomic<uint64_t> Scheduler::Transaction::next_id_; 8 : : 9 : 0 : bool Scheduler::autocommit (std::unique_ptr<ast::Command> command, Diagnostic &diag) { 10 : 0 : auto t = begin_transaction(); 11 [ # # ]: 0 : auto res_future = schedule_command(*t, std::move(command), diag); 12 [ # # ]: 0 : res_future.wait(); 13 [ # # # # ]: 0 : if (res_future.get()) { 14 [ # # ]: 0 : bool res = commit(std::move(t)); 15 [ # # ]: 0 : M_insist(res); 16 : 0 : return res; 17 : : } else { 18 [ # # ]: 0 : bool aborted = abort(std::move(t)); 19 [ # # ]: 0 : M_insist(aborted); 20 : 0 : return false; 21 : : } 22 : 0 : }