|
|
@ -1,7 +1,7 @@ |
|
|
|
/*****************************************************************************
|
|
|
|
|
|
|
|
Copyright (c) 2014, 2016, Oracle and/or its affiliates. All Rights Reserved. |
|
|
|
Copyright (c) 2017, MariaDB Corporation. |
|
|
|
Copyright (c) 2017, 2018, MariaDB Corporation. |
|
|
|
|
|
|
|
Portions of this file contain modifications contributed and copyrighted by |
|
|
|
Google, Inc. Those modifications are gratefully acknowledged and are described |
|
|
@ -1705,7 +1705,7 @@ private: |
|
|
|
}; |
|
|
|
|
|
|
|
/** Track latch creation location. For reducing the size of the latches */ |
|
|
|
static CreateTracker* create_tracker; |
|
|
|
static CreateTracker create_tracker; |
|
|
|
|
|
|
|
/** Register a latch, called when it is created
|
|
|
|
@param[in] ptr Latch instance that was created |
|
|
@ -1717,7 +1717,7 @@ sync_file_created_register( |
|
|
|
const char* filename, |
|
|
|
uint16_t line) |
|
|
|
{ |
|
|
|
create_tracker->register_latch(ptr, filename, line); |
|
|
|
create_tracker.register_latch(ptr, filename, line); |
|
|
|
} |
|
|
|
|
|
|
|
/** Deregister a latch, called when it is destroyed
|
|
|
@ -1725,7 +1725,7 @@ sync_file_created_register( |
|
|
|
void |
|
|
|
sync_file_created_deregister(const void* ptr) |
|
|
|
{ |
|
|
|
create_tracker->deregister_latch(ptr); |
|
|
|
create_tracker.deregister_latch(ptr); |
|
|
|
} |
|
|
|
|
|
|
|
/** Get the string where the file was created. Its format is "name:line"
|
|
|
@ -1734,7 +1734,7 @@ sync_file_created_deregister(const void* ptr) |
|
|
|
std::string |
|
|
|
sync_file_created_get(const void* ptr) |
|
|
|
{ |
|
|
|
return(create_tracker->get(ptr)); |
|
|
|
return(create_tracker.get(ptr)); |
|
|
|
} |
|
|
|
|
|
|
|
/** Initializes the synchronization data structures. */ |
|
|
@ -1744,12 +1744,6 @@ sync_check_init() |
|
|
|
ut_ad(!LatchDebug::s_initialized); |
|
|
|
ut_d(LatchDebug::s_initialized = true); |
|
|
|
|
|
|
|
/** For collecting latch statistic - SHOW ... MUTEX */ |
|
|
|
mutex_monitor = UT_NEW_NOKEY(MutexMonitor()); |
|
|
|
|
|
|
|
/** For trcking mutex creation location */ |
|
|
|
create_tracker = UT_NEW_NOKEY(CreateTracker()); |
|
|
|
|
|
|
|
sync_latch_meta_init(); |
|
|
|
|
|
|
|
/* Init the rw-lock & mutex list and create the mutex to protect it. */ |
|
|
@ -1773,14 +1767,6 @@ sync_check_close() |
|
|
|
|
|
|
|
sync_array_close(); |
|
|
|
|
|
|
|
UT_DELETE(mutex_monitor); |
|
|
|
|
|
|
|
mutex_monitor = NULL; |
|
|
|
|
|
|
|
UT_DELETE(create_tracker); |
|
|
|
|
|
|
|
create_tracker = NULL; |
|
|
|
|
|
|
|
sync_latch_meta_destroy(); |
|
|
|
} |
|
|
|
|