| 717 | */ |
| 718 | |
| 719 | void 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 | /** |
no test coverage detected