diff options
Diffstat (limited to 'storage/innobase/sync/sync0arr.cc')
-rw-r--r-- | storage/innobase/sync/sync0arr.cc | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc index b90a5f29589..749258021f7 100644 --- a/storage/innobase/sync/sync0arr.cc +++ b/storage/innobase/sync/sync0arr.cc @@ -39,6 +39,7 @@ Created 9/5/1995 Heikki Tuuri #include "sync0rw.h" #include "os0sync.h" #include "os0file.h" +#include "lock0lock.h" #include "srv0srv.h" #include "ha_prototypes.h" @@ -78,11 +79,11 @@ any waiting threads who have missed the signal. */ /** A cell where an individual thread may wait suspended until a resource is released. The suspending is implemented using an operating system event semaphore. */ -struct sync_cell_struct { +struct sync_cell_t { void* wait_object; /*!< pointer to the object the thread is waiting for; if NULL the cell is free for use */ - mutex_t* old_wait_mutex; /*!< the latest wait mutex in cell */ + ib_mutex_t* old_wait_mutex; /*!< the latest wait mutex in cell */ rw_lock_t* old_wait_rw_lock; /*!< the latest wait rw-lock in cell */ @@ -116,15 +117,15 @@ all changes (set or reset) to the state of the event must be made while owning the mutex. */ /** Synchronization array */ -struct sync_array_struct { +struct sync_array_t { ulint n_reserved; /*!< number of currently reserved cells in the wait array */ ulint n_cells; /*!< number of cells in the wait array */ sync_cell_t* array; /*!< pointer to wait array */ - mutex_t mutex; /*!< possible database mutex + ib_mutex_t mutex; /*!< possible database mutex protecting this data structure */ - os_mutex_t os_mutex; /*!< Possible operating system mutex + os_ib_mutex_t os_mutex; /*!< Possible operating system mutex protecting the data structure. As this data structure is used in constructing the database mutex, @@ -293,7 +294,7 @@ sync_cell_get_event( ulint type = cell->request_type; if (type == SYNC_MUTEX) { - return(((mutex_t*) cell->wait_object)->event); + return(((ib_mutex_t*) cell->wait_object)->event); } else if (type == RW_LOCK_WAIT_EX) { return(((rw_lock_t*) cell->wait_object)->wait_ex_event); } else { /* RW_LOCK_SHARED and RW_LOCK_EX wait on the same event */ @@ -434,7 +435,7 @@ sync_array_cell_print( FILE* file, /*!< in: file where to print */ sync_cell_t* cell) /*!< in: sync cell */ { - mutex_t* mutex; + ib_mutex_t* mutex; rw_lock_t* rwlock; ulint type; ulint writer; @@ -600,7 +601,7 @@ sync_array_detect_deadlock( sync_cell_t* cell, /*!< in: cell to search */ ulint depth) /*!< in: recursion depth */ { - mutex_t* mutex; + ib_mutex_t* mutex; rw_lock_t* lock; os_thread_id_t thread; ibool ret; @@ -622,7 +623,7 @@ sync_array_detect_deadlock( if (cell->request_type == SYNC_MUTEX) { - mutex = static_cast<mutex_t*>(cell->wait_object); + mutex = static_cast<ib_mutex_t*>(cell->wait_object); if (mutex_get_lock_word(mutex) != 0) { @@ -736,7 +737,7 @@ sync_arr_cell_can_wake_up( /*======================*/ sync_cell_t* cell) /*!< in: cell to search */ { - mutex_t* mutex; + ib_mutex_t* mutex; rw_lock_t* lock; if (cell->request_type == SYNC_MUTEX) { @@ -902,6 +903,11 @@ sync_array_print_long_waits_low( ibool fatal = FALSE; double longest_diff = 0; + /* For huge tables, skip the check during CHECK TABLE etc... */ + if (fatal_timeout > SRV_SEMAPHORE_WAIT_EXTENSION) { + return(FALSE); + } + #ifdef UNIV_DEBUG_VALGRIND /* Increase the timeouts if running under valgrind because it executes extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that @@ -1000,7 +1006,7 @@ sync_array_print_long_waits( (ulong) os_file_n_pending_pwrites); srv_print_innodb_monitor = TRUE; - os_event_set(srv_timeout_event); + os_event_set(lock_sys->timeout_event); os_thread_sleep(30000000); |