mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
Introduced WSREP_ASSERT() for public headers.
Public headers may be compiled with different preprocessor options than compilation units or private headers within a project. Introduced a macro WSREP_ASSERT() to be mainly used in public headers. The macro can be enabled by defining WSREP_LIB_HAVE_DEBUG and is enabled by default for Debug type builds.
This commit is contained in:
@ -20,10 +20,9 @@
|
||||
#ifndef WSREP_LOCK_HPP
|
||||
#define WSREP_LOCK_HPP
|
||||
|
||||
#include "assert.hpp"
|
||||
#include "mutex.hpp"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace wsrep
|
||||
{
|
||||
template <class M>
|
||||
@ -48,13 +47,13 @@ namespace wsrep
|
||||
void lock()
|
||||
{
|
||||
mutex_.lock();
|
||||
assert(locked_ == false);
|
||||
WSREP_ASSERT(locked_ == false);
|
||||
locked_ = true;
|
||||
}
|
||||
|
||||
void unlock()
|
||||
{
|
||||
assert(locked_);
|
||||
WSREP_ASSERT(locked_);
|
||||
locked_ = false;
|
||||
mutex_.unlock();
|
||||
}
|
||||
|
Reference in New Issue
Block a user