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