MCPcopy Create free account
hub / github.com/MariaDB/server / unlock

Method unlock

sql/sql_cache.cc:743–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741*/
742
743void Query_cache::unlock(void)
744{
745 DBUG_ENTER("Query_cache::unlock");
746 mysql_mutex_lock(&structure_guard_mutex);
747#ifndef DBUG_OFF
748 /* Thd may not be set in resize() at mysqld start */
749 THD *thd= current_thd;
750 if (thd)
751 DBUG_ASSERT(m_cache_lock_thread_id == thd->thread_id);
752#endif
753 DBUG_ASSERT(m_cache_lock_status == Query_cache::LOCKED ||
754 m_cache_lock_status == Query_cache::LOCKED_NO_WAIT);
755 m_cache_lock_status= Query_cache::UNLOCKED;
756 DBUG_PRINT("Query_cache",("Sending signal"));
757 mysql_cond_signal(&COND_cache_status_changed);
758 DBUG_ASSERT(m_requests_in_progress > 0);
759 m_requests_in_progress--;
760 if (m_requests_in_progress == 0 && m_cache_status == DISABLE_REQUEST)
761 {
762 /* No clients => just free query cache */
763 free_cache();
764 m_cache_status= DISABLED;
765 }
766 mysql_mutex_unlock(&structure_guard_mutex);
767 DBUG_VOID_RETURN;
768}
769
770
771/**

Callers 15

flush_slow_logMethod · 0.45
flush_general_logMethod · 0.45
wsrep_init_sidnoFunction · 0.45
write_unlockMethod · 0.45
fix_logFunction · 0.45
fix_log_outputFunction · 0.45
wait_for_replayersMethod · 0.45
clearMethod · 0.45
my_win_pcloseFunction · 0.45
copy_offline_tablesMethod · 0.45
pushMethod · 0.45
thread_funcMethod · 0.45

Calls 1

free_cacheFunction · 0.85

Tested by

no test coverage detected