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

Method lock

sql/sql_cache.cc:719–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717 */
718
719void Query_cache::lock(THD *thd)
720{
721 Query_cache_wait_state wait_state(thd, __func__, __FILE__, __LINE__);
722 DBUG_ENTER("Query_cache::lock");
723
724 mysql_mutex_lock(&structure_guard_mutex);
725 m_requests_in_progress++;
726 fix_local_query_cache_mode(thd);
727 while (m_cache_lock_status != Query_cache::UNLOCKED)
728 mysql_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
729 m_cache_lock_status= Query_cache::LOCKED;
730#ifndef DBUG_OFF
731 m_cache_lock_thread_id= thd->thread_id;
732#endif
733 mysql_mutex_unlock(&structure_guard_mutex);
734
735 DBUG_VOID_RETURN;
736}
737
738
739/**

Callers 5

wait_for_replayersMethod · 0.45
thread_funcMethod · 0.45
executeMethod · 0.45
~task_groupMethod · 0.45
maintenanceMethod · 0.45

Calls 1

Tested by

no test coverage detected