16 #ifndef NDB_SEQLOCK_HPP
17 #define NDB_SEQLOCK_HPP
19 #include <ndb_types.h>
22 #if defined (NDB_HAVE_RMB) && defined(NDB_HAVE_WMB)
26 volatile Uint32 m_seq;
32 bool read_unlock(Uint32 val)
const;
37 NdbSeqLock::write_lock()
39 assert((m_seq & 1) == 0);
46 NdbSeqLock::write_unlock()
48 assert((m_seq & 1) == 1);
55 NdbSeqLock::read_lock()
60 if (unlikely(val & 1))
62 #ifdef NDB_HAVE_CPU_PAUSE
72 NdbSeqLock::read_unlock(Uint32 val)
const
87 void write_unlock() {}
89 Uint32 read_lock() {
return 0; }
90 bool read_unlock(Uint32 val)
const {
return true;}