~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innobase/include/dict0dict.ic

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
298
298
        return(UNIV_LIKELY(table->flags & DICT_TF_COMPACT));
299
299
}
300
300
 
 
301
/*********************************************************************//**
 
302
Obtain exclusive locks on all index trees of the table. This is to prevent
 
303
accessing index trees while InnoDB is updating internal metadata for
 
304
operations such as truncate tables. */
 
305
UNIV_INLINE
 
306
void
 
307
dict_table_x_lock_indexes(
 
308
/*======================*/
 
309
        dict_table_t*   table)  /* in: table */
 
310
{
 
311
        dict_index_t*   index;
 
312
 
 
313
        ut_a(table);
 
314
        ut_ad(mutex_own(&(dict_sys->mutex)));
 
315
 
 
316
        /* Loop through each index of the table and lock them */
 
317
        for (index = dict_table_get_first_index(table);
 
318
             index != NULL;
 
319
             index = dict_table_get_next_index(index)) {
 
320
                rw_lock_x_lock(dict_index_get_lock(index));
 
321
        }
 
322
}
 
323
 
 
324
/*********************************************************************//**
 
325
Release the exclusive locks on all index tree. */
 
326
UNIV_INLINE
 
327
void
 
328
dict_table_x_unlock_indexes(
 
329
/*========================*/
 
330
        dict_table_t*   table)  /* in: table */
 
331
{
 
332
        dict_index_t*   index;
 
333
 
 
334
        ut_a(table);
 
335
        ut_ad(mutex_own(&(dict_sys->mutex)));
 
336
 
 
337
        for (index = dict_table_get_first_index(table);
 
338
             index != NULL;
 
339
             index = dict_table_get_next_index(index)) {
 
340
                rw_lock_x_unlock(dict_index_get_lock(index));
 
341
        }
 
342
}
301
343
/************************************************************************
302
344
Gets the number of fields in the internal representation of an index,
303
345
including fields added by the dictionary system. */