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

Function plugin_lock_by_name

sql/sql_plugin.cc:1077–1090  ·  view source on GitHub ↗

Notes on lifetime: If THD is passed as non-NULL (and with a non-NULL thd->lex), an entry is made in the thd->lex which will cause an automatic unlock of the plugin in the LEX destructor. In this case, no manual unlock must be done. Otherwise, when passing a NULL THD, the caller must arrange that plugin unlock happens later. */

Source from the content-addressed store, hash-verified

1075 unlock happens later.
1076*/
1077plugin_ref plugin_lock_by_name(THD *thd, const LEX_CSTRING *name, int type)
1078{
1079 LEX *lex= thd ? thd->lex : 0;
1080 plugin_ref rc= NULL;
1081 st_plugin_int *plugin;
1082 DBUG_ENTER("plugin_lock_by_name");
1083 if (!name->length)
1084 DBUG_RETURN(NULL);
1085 mysql_mutex_lock(&LOCK_plugin);
1086 if ((plugin= plugin_find_internal(name, type)))
1087 rc= intern_plugin_lock(lex, plugin_int_to_ref(plugin));
1088 mysql_mutex_unlock(&LOCK_plugin);
1089 DBUG_RETURN(rc);
1090}
1091
1092
1093static st_plugin_int *plugin_insert_or_reuse(struct st_plugin_int *plugin)

Callers 2

ha_table_existsFunction · 0.85
mysql_rm_table_no_locksFunction · 0.85

Calls 2

plugin_find_internalFunction · 0.85
intern_plugin_lockFunction · 0.85

Tested by

no test coverage detected