Skip to content

Commit

Permalink
MDEV-9282 follow-up: Remove an unused variable.
Browse files Browse the repository at this point in the history
Remove the unused variable innodb_calling_exit which was added
in MySQL 5.7 in an attempt to avoid failures in other threads when
an I/O thread calls exit().

Since MDEV-9282, InnoDB or XtraDB MariaDB Server is not calling
exit() at all, and the variable innodb_calling_exit was never set.
  • Loading branch information
dr-m committed Mar 6, 2017
1 parent ff0530e commit 7331b83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
9 changes: 5 additions & 4 deletions storage/innobase/include/ib0mutex.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -74,7 +75,7 @@ struct OSTrackMutex {
void destroy() UNIV_NOTHROW
{
ut_ad(!m_locked);
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);

m_mutex.destroy();

Expand All @@ -86,7 +87,7 @@ struct OSTrackMutex {
{
ut_ad(m_locked);
ut_d(m_locked = false);
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);

m_mutex.exit();
}
Expand All @@ -103,7 +104,7 @@ struct OSTrackMutex {
uint32_t line)
UNIV_NOTHROW
{
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);

m_mutex.enter();

Expand All @@ -114,7 +115,7 @@ struct OSTrackMutex {
/** @return true if locking succeeded */
bool try_lock() UNIV_NOTHROW
{
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);

bool locked = m_mutex.try_lock();

Expand Down
14 changes: 5 additions & 9 deletions storage/innobase/include/sync0types.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -33,11 +34,6 @@ Created 9/5/1995 Heikki Tuuri
#include "ut0new.h"
#include "ut0counter.h"

#if defined(UNIV_DEBUG) && !defined(UNIV_INNOCHECKSUM)
/** Set when InnoDB has invoked exit(). */
extern bool innodb_calling_exit;
#endif /* UNIV_DEBUG && !UNIV_INNOCHECKSUM */

#ifdef _WIN32
/** Native mutex */
typedef CRITICAL_SECTION sys_mutex_t;
Expand Down Expand Up @@ -436,7 +432,7 @@ struct OSMutex {
void destroy()
UNIV_NOTHROW
{
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);
#ifdef _WIN32
DeleteCriticalSection((LPCRITICAL_SECTION) &m_mutex);
#else
Expand All @@ -458,7 +454,7 @@ struct OSMutex {
void exit()
UNIV_NOTHROW
{
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);
#ifdef _WIN32
LeaveCriticalSection(&m_mutex);
#else
Expand All @@ -471,7 +467,7 @@ struct OSMutex {
void enter()
UNIV_NOTHROW
{
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);
#ifdef _WIN32
EnterCriticalSection((LPCRITICAL_SECTION) &m_mutex);
#else
Expand All @@ -484,7 +480,7 @@ struct OSMutex {
bool try_lock()
UNIV_NOTHROW
{
ut_ad(innodb_calling_exit || !m_freed);
ut_ad(!m_freed);
#ifdef _WIN32
return(TryEnterCriticalSection(&m_mutex) != 0);
#else
Expand Down
5 changes: 0 additions & 5 deletions storage/innobase/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ Created 10/21/1995 Heikki Tuuri
# include <linux/falloc.h>
#endif /* HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE */

#ifdef UNIV_DEBUG
/** Set when InnoDB has invoked exit(). */
bool innodb_calling_exit;
#endif /* UNIV_DEBUG */

#if defined(UNIV_LINUX) && defined(HAVE_SYS_IOCTL_H)
# include <sys/ioctl.h>
# ifndef DFS_IOCTL_ATOMIC_WRITE_SET
Expand Down

0 comments on commit 7331b83

Please sign in to comment.