Skip to content

Commit

Permalink
Avoid assert()
Browse files Browse the repository at this point in the history
By default, CMAKE_BUILD_TYPE RelWithDebInfo or Release implies -DNDEBUG,
which disables the assert() macro. MariaDB is deviating from that.
Let us be explicit to use assert() only in debug builds.

This fixes up 1b8358d
  • Loading branch information
dr-m committed Jan 10, 2025
1 parent 1b8358d commit ff1f611
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions storage/innobase/include/trx0trx.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,14 +618,14 @@ struct trx_t : ilist_node<>
{
ut_ad(!mutex_is_owner());
mutex.wr_lock();
assert(!mutex_owner.exchange(pthread_self(),
std::memory_order_relaxed));
ut_d(assert(!mutex_owner.exchange(pthread_self(),
std::memory_order_relaxed)));
}
/** Release the mutex */
void mutex_unlock()
{
assert(mutex_owner.exchange(0, std::memory_order_relaxed) ==
pthread_self());
ut_d(assert(mutex_owner.exchange(0, std::memory_order_relaxed) ==
pthread_self()));
mutex.wr_unlock();
}
#ifndef SUX_LOCK_GENERIC
Expand Down

0 comments on commit ff1f611

Please sign in to comment.