diff options
author | monty@hundin.mysql.fi <> | 2002-06-29 20:26:33 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2002-06-29 20:26:33 +0300 |
commit | 0573b66df3b9d0a35a043a97955c6deb59e71597 (patch) | |
tree | 3f4af5895e26720092bbc9a5f40873681337d97e /sql/log.cc | |
parent | 66f86faafd7be135ed36ef1fb9382481f5b9f6f2 (diff) | |
download | mariadb-git-0573b66df3b9d0a35a043a97955c6deb59e71597.tar.gz |
Added support for rw_tryrdlock() and rw_trywrlock()
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/log.cc b/sql/log.cc index b0483ea4a27..f8bcd05510d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -888,15 +888,15 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command, bool MYSQL_LOG::write(Log_event* event_info) { - /* In most cases this is only called if 'is_open()' is true */ bool error=0; - bool should_rotate = 0; if (!inited) // Can't use mutex if not init return 0; VOID(pthread_mutex_lock(&LOCK_log)); + /* In most cases this is only called if 'is_open()' is true */ if (is_open()) { + bool should_rotate = 0; THD *thd=event_info->thd; const char* db = event_info->get_db(); #ifdef USING_TRANSACTIONS @@ -985,9 +985,9 @@ err: } if (file == &log_file) signal_update(); + if (should_rotate) + new_file(1); // inside mutex } - if (should_rotate) - new_file(1); // inside mutex VOID(pthread_mutex_unlock(&LOCK_log)); return error; } |