Commit 863cfb3f authored by Sergei Golubchik's avatar Sergei Golubchik

small cleanup, remove a useless function

parent b050354f
......@@ -32,7 +32,6 @@
#include "sql_acl.h" // SUPER_ACL
#include "sql_base.h" // free_io_cache
#include "discover.h" // extension_based_table_discovery, etc
#include "log.h" // for assert_LOCK_log_owner
#include "log_event.h" // *_rows_log_event
#include "create_options.h"
#include "rpl_filter.h"
......@@ -1479,9 +1478,8 @@ int ha_commit_trans(THD *thd, bool all)
done:
DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE(););
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
assert_LOCK_log_owner(false);
mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
RUN_HOOK(transaction, after_commit, (thd, FALSE));
......
......@@ -6042,7 +6042,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
}
else
{
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_owner(&LOCK_log);
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
......@@ -6079,7 +6078,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
mysql_mutex_lock(&LOCK_after_binlog_sync);
mysql_mutex_unlock(&LOCK_log);
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_not_owner(&LOCK_log);
mysql_mutex_assert_owner(&LOCK_after_binlog_sync);
......@@ -7410,7 +7408,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
bool any_error= false;
bool all_error= true;
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_owner(&LOCK_log);
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
......@@ -7498,7 +7495,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
Loop through threads and run the binlog_sync hook
*/
{
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_not_owner(&LOCK_log);
mysql_mutex_assert_owner(&LOCK_after_binlog_sync);
......@@ -9853,14 +9849,6 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
}
}
void assert_LOCK_log_owner(bool owner)
{
if (owner)
mysql_mutex_assert_owner(mysql_bin_log.get_log_lock());
else
mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
}
struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
......
......@@ -343,7 +343,6 @@ class MYSQL_LOG
PSI_file_key m_log_file_key;
#endif
/* for documentation of mutexes held in various places in code */
friend void assert_LOCK_log_owner(bool owner);
};
class MYSQL_QUERY_LOG: public MYSQL_LOG
......@@ -1153,8 +1152,4 @@ static inline TC_LOG *get_tc_log_implementation()
return &tc_log_mmap;
}
void assert_LOCK_log_owner(bool owner);
void assert_LOCK_log_owner(bool owner);
#endif /* LOG_H */
......@@ -2655,7 +2655,7 @@ static int send_one_binlog_file(binlog_send_info *info,
LOG_INFO* linfo,
my_off_t start_pos)
{
assert_LOCK_log_owner(false); // we don't have LOCK_log
mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
/* seek to the requested position, to start the requested dump */
if (start_pos != BIN_LOG_HEADER_SIZE)
......
......@@ -24,7 +24,6 @@
#include "rpl_handler.h"
#include "debug_sync.h" // DEBUG_SYNC
#include "sql_acl.h"
#include "log.h" // for assert_LOCK_log_owner
/* Conditions under which the transaction state must not change. */
static bool trans_check(THD *thd)
......@@ -234,9 +233,8 @@ bool trans_commit(THD *thd)
DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS"));
res= ha_commit_trans(thd, TRUE);
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
assert_LOCK_log_owner(false);
mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
......@@ -441,9 +439,8 @@ bool trans_commit_stmt(THD *thd)
}
}
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
assert_LOCK_log_owner(false);
mysql_mutex_assert_not_owner(mysql_bin_log.get_log_lock());
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment