1/***************************************************************************** 2 3Copyright (c) 2012, 2018, Oracle and/or its affiliates. All Rights Reserved. 4 5This program is free software; you can redistribute it and/or modify it under 6the terms of the GNU General Public License, version 2.0, as published by the 7Free Software Foundation. 8 9This program is also distributed with certain software (including but not 10limited to OpenSSL) that is licensed under separate terms, as designated in a 11particular file or component or in included license documentation. The authors 12of MySQL hereby grant you an additional permission to link the program and 13your derivative works with the separately licensed software that they have 14included with MySQL. 15 16This program is distributed in the hope that it will be useful, but WITHOUT 17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 19for more details. 20 21You should have received a copy of the GNU General Public License along with 22this program; if not, write to the Free Software Foundation, Inc., 2351 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 24 25*****************************************************************************/ 26 27/** @file include/dict0stats_bg.ic 28 Code used for background table and index stats gathering. 29 30 Created Feb 8, 2013 Marko Makela 31 *******************************************************/ 32 33#include "dict0dict.h" 34#include "dict0mem.h" 35 36/** Request the background collection of statistics to stop for a table. 37 @retval true when no background process is active 38 @retval false when it is not safe to modify the table definition */ 39UNIV_INLINE 40bool dict_stats_stop_bg(dict_table_t *table) /*!< in/out: table */ 41{ 42 ut_ad(!srv_read_only_mode); 43 ut_ad(mutex_own(&dict_sys->mutex)); 44 45 if (!(table->stats_bg_flag & BG_STAT_IN_PROGRESS)) { 46 return (true); 47 } 48 49 table->stats_bg_flag |= BG_STAT_SHOULD_QUIT; 50 return (false); 51} 52