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

Function tdc_lock_share

sql/table_cache.cc:739–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737*/
738
739TDC_element *tdc_lock_share(THD *thd, const char *db, const char *table_name)
740{
741 TDC_element *element;
742 char key[MAX_DBKEY_LENGTH];
743
744 DBUG_ENTER("tdc_lock_share");
745 if (unlikely(fix_thd_pins(thd)))
746 DBUG_RETURN((TDC_element*) MY_ERRPTR);
747
748 element= (TDC_element *) lf_hash_search(&tdc_hash, thd->tdc_hash_pins,
749 (uchar*) key,
750 tdc_create_key(key, db, table_name));
751 if (element)
752 {
753 mysql_mutex_lock(&element->LOCK_table_share);
754 if (unlikely(!element->share || element->share->error))
755 {
756 mysql_mutex_unlock(&element->LOCK_table_share);
757 element= 0;
758 }
759 lf_hash_search_unpin(thd->tdc_hash_pins);
760 }
761
762 DBUG_RETURN(element);
763}
764
765
766/**

Callers 3

tdc_remove_tableFunction · 0.85
tdc_wait_for_old_versionFunction · 0.85
ha_table_existsFunction · 0.85

Calls 3

lf_hash_searchFunction · 0.85
tdc_create_keyFunction · 0.85
fix_thd_pinsFunction · 0.70

Tested by

no test coverage detected