mirror of https://gitee.com/bigwinds/arangodb
remove configure option --enable-lock-check. has done its purpose already
This commit is contained in:
parent
22c1252a4f
commit
a08b5ac230
|
@ -68,7 +68,6 @@ extern "C" {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_READ_LOCK_DATAFILES_DOC_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("read-locking datafiles %p", a); \
|
||||
TRI_ReadLockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -76,7 +75,6 @@ extern "C" {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_READ_UNLOCK_DATAFILES_DOC_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("read-unlocking datafiles %p", a); \
|
||||
TRI_ReadUnlockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -84,7 +82,6 @@ extern "C" {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_WRITE_LOCK_DATAFILES_DOC_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("write-locking datafiles %p", a); \
|
||||
TRI_WriteLockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -92,7 +89,6 @@ extern "C" {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_WRITE_UNLOCK_DATAFILES_DOC_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("write-unlocking datafiles %p", a); \
|
||||
TRI_WriteUnlockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -58,7 +58,6 @@ struct TRI_cap_constraint_s;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_READ_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("read-locking collection index %p", a); \
|
||||
TRI_ReadLockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -66,7 +65,6 @@ struct TRI_cap_constraint_s;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_READ_UNLOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("read-unlocking collection index %p", a); \
|
||||
TRI_ReadUnlockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -74,7 +72,6 @@ struct TRI_cap_constraint_s;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_WRITE_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("write-locking collection index %p", a); \
|
||||
TRI_WriteLockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -82,7 +79,6 @@ struct TRI_cap_constraint_s;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_WRITE_UNLOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION(a) \
|
||||
TRI_LOCK_CHECK_TRACE("write-unlocking collection index %p", a); \
|
||||
TRI_WriteUnlockReadWriteLock(&(a)->_lock)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -83,12 +83,6 @@
|
|||
|
||||
#undef TRI_ENABLE_MRUBY
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief perform lock checking
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#undef TRI_ENABLE_LOCK_CHECK
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -76,17 +76,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_InitMutex (TRI_mutex_t* mutex) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
pthread_mutexattr_t attr;
|
||||
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
|
||||
|
||||
assert(mutex);
|
||||
pthread_mutex_init(mutex, &attr);
|
||||
#else
|
||||
pthread_mutex_init(mutex, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -94,9 +84,6 @@ void TRI_InitMutex (TRI_mutex_t* mutex) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_DestroyMutex (TRI_mutex_t* mutex) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(mutex);
|
||||
#endif
|
||||
pthread_mutex_destroy(mutex);
|
||||
}
|
||||
|
||||
|
@ -120,9 +107,6 @@ void TRI_DestroyMutex (TRI_mutex_t* mutex) {
|
|||
void TRI_LockMutex (TRI_mutex_t* mutex) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(mutex);
|
||||
#endif
|
||||
rc = pthread_mutex_lock(mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -142,10 +126,6 @@ void TRI_LockMutex (TRI_mutex_t* mutex) {
|
|||
void TRI_UnlockMutex (TRI_mutex_t* mutex) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(mutex);
|
||||
// never LOG_XXX something here. this will cause infinite recursing (logging uses a mutex)
|
||||
#endif
|
||||
rc = pthread_mutex_unlock(mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -179,9 +159,6 @@ void TRI_UnlockMutex (TRI_mutex_t* mutex) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_InitSpin (TRI_spin_t* spinLock) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(spinLock);
|
||||
#endif
|
||||
pthread_spin_init(spinLock, 0);
|
||||
}
|
||||
|
||||
|
@ -190,9 +167,6 @@ void TRI_InitSpin (TRI_spin_t* spinLock) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_DestroySpin (TRI_spin_t* spinLock) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(spinLock);
|
||||
#endif
|
||||
pthread_spin_destroy(spinLock);
|
||||
}
|
||||
|
||||
|
@ -216,9 +190,6 @@ void TRI_DestroySpin (TRI_spin_t* spinLock) {
|
|||
void TRI_LockSpin (TRI_spin_t* spinLock) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(spinLock);
|
||||
#endif
|
||||
rc = pthread_spin_lock(spinLock);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -238,9 +209,6 @@ void TRI_LockSpin (TRI_spin_t* spinLock) {
|
|||
void TRI_UnlockSpin (TRI_spin_t* spinLock) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(spinLock);
|
||||
#endif
|
||||
rc = pthread_spin_unlock(spinLock);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -274,9 +242,6 @@ void TRI_UnlockSpin (TRI_spin_t* spinLock) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_InitReadWriteLock (TRI_read_write_lock_t* lock) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(lock);
|
||||
#endif
|
||||
pthread_rwlock_init(lock, 0);
|
||||
}
|
||||
|
||||
|
@ -285,9 +250,6 @@ void TRI_InitReadWriteLock (TRI_read_write_lock_t* lock) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_DestroyReadWriteLock (TRI_read_write_lock_t* lock) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(lock);
|
||||
#endif
|
||||
pthread_rwlock_destroy(lock);
|
||||
}
|
||||
|
||||
|
@ -311,9 +273,6 @@ void TRI_DestroyReadWriteLock (TRI_read_write_lock_t* lock) {
|
|||
bool TRI_TryReadLockReadWriteLock (TRI_read_write_lock_t* lock) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(lock);
|
||||
#endif
|
||||
rc = pthread_rwlock_tryrdlock(lock);
|
||||
|
||||
return (rc == 0);
|
||||
|
@ -327,10 +286,6 @@ void TRI_ReadLockReadWriteLock (TRI_read_write_lock_t* lock) {
|
|||
int rc;
|
||||
bool complained = false;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(lock);
|
||||
#endif
|
||||
|
||||
again:
|
||||
rc = pthread_rwlock_rdlock(lock);
|
||||
|
||||
|
@ -369,9 +324,6 @@ again:
|
|||
void TRI_ReadUnlockReadWriteLock (TRI_read_write_lock_t* lock) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(lock);
|
||||
#endif
|
||||
rc = pthread_rwlock_unlock(lock);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -388,9 +340,6 @@ void TRI_ReadUnlockReadWriteLock (TRI_read_write_lock_t* lock) {
|
|||
void TRI_WriteLockReadWriteLock (TRI_read_write_lock_t* lock) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(lock);
|
||||
#endif
|
||||
rc = pthread_rwlock_wrlock(lock);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -410,9 +359,6 @@ void TRI_WriteLockReadWriteLock (TRI_read_write_lock_t* lock) {
|
|||
void TRI_WriteUnlockReadWriteLock (TRI_read_write_lock_t* lock) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(lock);
|
||||
#endif
|
||||
rc = pthread_rwlock_unlock(lock);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -444,9 +390,6 @@ void TRI_WriteUnlockReadWriteLock (TRI_read_write_lock_t* lock) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_InitCondition (TRI_condition_t* cond) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
pthread_cond_init(&cond->_cond, 0);
|
||||
|
||||
cond->_ownMutex = true;
|
||||
|
@ -466,10 +409,6 @@ void TRI_InitCondition (TRI_condition_t* cond) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_Init2Condition (TRI_condition_t* cond, TRI_mutex_t* mutex) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
assert(mutex);
|
||||
#endif
|
||||
pthread_cond_init(&cond->_cond, 0);
|
||||
|
||||
cond->_ownMutex = false;
|
||||
|
@ -481,9 +420,6 @@ void TRI_Init2Condition (TRI_condition_t* cond, TRI_mutex_t* mutex) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_DestroyCondition (TRI_condition_t* cond) {
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
pthread_cond_destroy(&cond->_cond);
|
||||
|
||||
if (cond->_ownMutex) {
|
||||
|
@ -514,9 +450,6 @@ void TRI_DestroyCondition (TRI_condition_t* cond) {
|
|||
void TRI_SignalCondition (TRI_condition_t* cond) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
rc = pthread_cond_signal(&cond->_cond);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -535,9 +468,6 @@ void TRI_SignalCondition (TRI_condition_t* cond) {
|
|||
void TRI_BroadcastCondition (TRI_condition_t* cond) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
rc = pthread_cond_broadcast(&cond->_cond);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -556,9 +486,6 @@ void TRI_BroadcastCondition (TRI_condition_t* cond) {
|
|||
void TRI_WaitCondition (TRI_condition_t* cond) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
rc = pthread_cond_wait(&cond->_cond, cond->_mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -596,9 +523,6 @@ bool TRI_TimedWaitCondition (TRI_condition_t* cond, uint64_t delay) {
|
|||
ts.tv_sec = ts.tv_sec + ((x - y) / 1000000000);
|
||||
|
||||
// and wait
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
rc = pthread_cond_timedwait(&cond->_cond, cond->_mutex, &ts);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -621,9 +545,6 @@ bool TRI_TimedWaitCondition (TRI_condition_t* cond, uint64_t delay) {
|
|||
void TRI_LockCondition (TRI_condition_t* cond) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
rc = pthread_mutex_lock(cond->_mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
|
@ -640,9 +561,6 @@ void TRI_LockCondition (TRI_condition_t* cond) {
|
|||
void TRI_UnlockCondition (TRI_condition_t* cond) {
|
||||
int rc;
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
assert(cond);
|
||||
#endif
|
||||
rc = pthread_mutex_unlock(cond->_mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
|
|
|
@ -39,16 +39,6 @@
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief log a trace message for locking operations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_LOCK_CHECK
|
||||
#define TRI_LOCK_CHECK_TRACE(...) LOG_TRACE(__VA_ARGS__);
|
||||
#else
|
||||
#define TRI_LOCK_CHECK_TRACE(...) ;
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -61,18 +61,3 @@ if test "x$tr_cv_broken_cxa_guard" = xyes; then
|
|||
AC_DEFINE([BROKEN_CXA_GUARD], [1], [static programs have broken cxa_guard])
|
||||
fi
|
||||
|
||||
dnl -----------------------------------------------------------------------------------------
|
||||
dnl option for lock checking
|
||||
dnl -----------------------------------------------------------------------------------------
|
||||
|
||||
AC_ARG_ENABLE(lock-check,
|
||||
AS_HELP_STRING([--enable-lock-check], [enables lock checking (default: no)]),
|
||||
tr_LOCK_CHECK="${enableval:-yes}",
|
||||
tr_LOCK_CHECK=no
|
||||
)
|
||||
|
||||
if test "x$tr_LOCK_CHECK" = xyes; then
|
||||
AC_DEFINE_UNQUOTED(TRI_ENABLE_LOCK_CHECK, 1, [true if lock checking should be performed])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_LOCK_CHECK, test "x$tr_LOCK_CHECK" = xyes)
|
||||
|
|
Loading…
Reference in New Issue