From 3e0534c610fafa6912f36c114142999b27557b9b Mon Sep 17 00:00:00 2001 From: Kruno Tomola Fabro Date: Tue, 6 Sep 2016 13:12:11 +0100 Subject: [PATCH] Removed RecordLock from record. It wasn't used. --- include/mvcc/hints.hpp | 29 ++++++++++------------------- include/mvcc/record.hpp | 3 ++- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/include/mvcc/hints.hpp b/include/mvcc/hints.hpp index f9fe5837a..e95a4ecb2 100644 --- a/include/mvcc/hints.hpp +++ b/include/mvcc/hints.hpp @@ -19,7 +19,8 @@ public: union HintBits; private: - enum Flags : uint8_t { + enum Flags : uint8_t + { CRE_CMT = 0x01, // __01 CRE_ABT = 0x02, // __10 EXP_CMT = 0x04, // 01__ @@ -32,19 +33,13 @@ private: using type = TxHints; public: - TxHints(std::atomic& bits) : bits(bits) {} + TxHints(std::atomic &bits) : bits(bits) {} struct Value { - bool is_committed() const - { - return bits & COMMITTED; - } + bool is_committed() const { return bits & COMMITTED; } - bool is_aborted() const - { - return bits & ABORTED; - } + bool is_aborted() const { return bits & ABORTED; } bool is_unknown() const { @@ -56,7 +51,7 @@ private: Value load(std::memory_order order = std::memory_order_seq_cst) { - return Value { bits.load(order) }; + return Value{bits.load(order)}; } void set_committed(std::memory_order order = std::memory_order_seq_cst) @@ -70,7 +65,7 @@ private: } private: - std::atomic& bits; + std::atomic &bits; }; struct Cre : public TxHints @@ -84,10 +79,7 @@ private: }; public: - Hints() : cre(bits), exp(bits) - { - assert(bits.is_lock_free()); - } + Hints() : cre(bits), exp(bits) { assert(bits.is_lock_free()); } union HintBits { @@ -99,13 +91,12 @@ public: HintBits load(std::memory_order order = std::memory_order_seq_cst) { - return HintBits { bits.load(order) }; + return HintBits{bits.load(order)}; } Cre cre; Exp exp; - std::atomic bits { 0 }; + std::atomic bits{0}; }; - } diff --git a/include/mvcc/record.hpp b/include/mvcc/record.hpp index aab7c63e9..4aa24d03c 100644 --- a/include/mvcc/record.hpp +++ b/include/mvcc/record.hpp @@ -37,8 +37,9 @@ public: Hints hints; + // NOTE: Wasn't used. // this lock is used by write queries when they update or delete records - RecordLock lock; + // RecordLock lock; // check if this record is visible to the transaction t bool visible(const tx::Transaction &t)