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

small cleanup, remove a useless function

parent b050354f
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "sql_acl.h" // SUPER_ACL #include "sql_acl.h" // SUPER_ACL
#include "sql_base.h" // free_io_cache #include "sql_base.h" // free_io_cache
#include "discover.h" // extension_based_table_discovery, etc #include "discover.h" // extension_based_table_discovery, etc
#include "log.h" // for assert_LOCK_log_owner
#include "log_event.h" // *_rows_log_event #include "log_event.h" // *_rows_log_event
#include "create_options.h" #include "create_options.h"
#include "rpl_filter.h" #include "rpl_filter.h"
...@@ -1479,9 +1478,8 @@ int ha_commit_trans(THD *thd, bool all) ...@@ -1479,9 +1478,8 @@ int ha_commit_trans(THD *thd, bool all)
done: done:
DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE();); DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE(););
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered); 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_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered); mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
RUN_HOOK(transaction, after_commit, (thd, FALSE)); RUN_HOOK(transaction, after_commit, (thd, FALSE));
......
...@@ -6042,7 +6042,6 @@ err: ...@@ -6042,7 +6042,6 @@ err:
} }
else else
{ {
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered); mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_owner(&LOCK_log); mysql_mutex_assert_owner(&LOCK_log);
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync); mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
...@@ -6079,7 +6078,6 @@ err: ...@@ -6079,7 +6078,6 @@ err:
mysql_mutex_lock(&LOCK_after_binlog_sync); mysql_mutex_lock(&LOCK_after_binlog_sync);
mysql_mutex_unlock(&LOCK_log); 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_prepare_ordered);
mysql_mutex_assert_not_owner(&LOCK_log); mysql_mutex_assert_not_owner(&LOCK_log);
mysql_mutex_assert_owner(&LOCK_after_binlog_sync); mysql_mutex_assert_owner(&LOCK_after_binlog_sync);
...@@ -7410,7 +7408,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader) ...@@ -7410,7 +7408,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
bool any_error= false; bool any_error= false;
bool all_error= true; bool all_error= true;
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered); mysql_mutex_assert_not_owner(&LOCK_prepare_ordered);
mysql_mutex_assert_owner(&LOCK_log); mysql_mutex_assert_owner(&LOCK_log);
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync); mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
...@@ -7498,7 +7495,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader) ...@@ -7498,7 +7495,6 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
Loop through threads and run the binlog_sync hook 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_prepare_ordered);
mysql_mutex_assert_not_owner(&LOCK_log); mysql_mutex_assert_not_owner(&LOCK_log);
mysql_mutex_assert_owner(&LOCK_after_binlog_sync); mysql_mutex_assert_owner(&LOCK_after_binlog_sync);
...@@ -9853,14 +9849,6 @@ TC_LOG_BINLOG::set_status_variables(THD *thd) ...@@ -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= struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION }; { MYSQL_HANDLERTON_INTERFACE_VERSION };
......
...@@ -343,7 +343,6 @@ public: ...@@ -343,7 +343,6 @@ public:
PSI_file_key m_log_file_key; PSI_file_key m_log_file_key;
#endif #endif
/* for documentation of mutexes held in various places in code */ /* 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 class MYSQL_QUERY_LOG: public MYSQL_LOG
...@@ -1153,8 +1152,4 @@ static inline TC_LOG *get_tc_log_implementation() ...@@ -1153,8 +1152,4 @@ static inline TC_LOG *get_tc_log_implementation()
return &tc_log_mmap; return &tc_log_mmap;
} }
void assert_LOCK_log_owner(bool owner);
void assert_LOCK_log_owner(bool owner);
#endif /* LOG_H */ #endif /* LOG_H */
...@@ -2655,7 +2655,7 @@ static int send_one_binlog_file(binlog_send_info *info, ...@@ -2655,7 +2655,7 @@ static int send_one_binlog_file(binlog_send_info *info,
LOG_INFO* linfo, LOG_INFO* linfo,
my_off_t start_pos) 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 */ /* seek to the requested position, to start the requested dump */
if (start_pos != BIN_LOG_HEADER_SIZE) if (start_pos != BIN_LOG_HEADER_SIZE)
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "rpl_handler.h" #include "rpl_handler.h"
#include "debug_sync.h" // DEBUG_SYNC #include "debug_sync.h" // DEBUG_SYNC
#include "sql_acl.h" #include "sql_acl.h"
#include "log.h" // for assert_LOCK_log_owner
/* Conditions under which the transaction state must not change. */ /* Conditions under which the transaction state must not change. */
static bool trans_check(THD *thd) static bool trans_check(THD *thd)
...@@ -234,9 +233,8 @@ bool trans_commit(THD *thd) ...@@ -234,9 +233,8 @@ bool trans_commit(THD *thd)
DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS"));
res= ha_commit_trans(thd, TRUE); res= ha_commit_trans(thd, TRUE);
/* documentation of which mutexes are (not) owned */
mysql_mutex_assert_not_owner(&LOCK_prepare_ordered); 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_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered); mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
...@@ -441,9 +439,8 @@ bool trans_commit_stmt(THD *thd) ...@@ -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); 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_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered); 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