@@ -1397,10 +1397,10 @@ static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin,
13971397
13981398 mysql_mutex_unlock (&LOCK_plugin);
13991399
1400- mysql_rwlock_wrlock (&LOCK_system_variables_hash);
1400+ mysql_prlock_wrlock (&LOCK_system_variables_hash);
14011401 if (test_plugin_options (tmp_root, plugin, argc, argv))
14021402 state= PLUGIN_IS_DISABLED;
1403- mysql_rwlock_unlock (&LOCK_system_variables_hash);
1403+ mysql_prlock_unlock (&LOCK_system_variables_hash);
14041404
14051405 if (options_only || state == PLUGIN_IS_DISABLED)
14061406 {
@@ -2803,11 +2803,11 @@ sys_var *find_sys_var_ex(THD *thd, const char *str, size_t length,
28032803
28042804 if (!locked)
28052805 mysql_mutex_lock (&LOCK_plugin);
2806- mysql_rwlock_rdlock (&LOCK_system_variables_hash);
2806+ mysql_prlock_rdlock (&LOCK_system_variables_hash);
28072807 if ((var= intern_find_sys_var (str, length)) &&
28082808 (pi= var->cast_pluginvar ()))
28092809 {
2810- mysql_rwlock_unlock (&LOCK_system_variables_hash);
2810+ mysql_prlock_unlock (&LOCK_system_variables_hash);
28112811 LEX *lex= thd ? thd->lex : 0 ;
28122812 if (!(plugin= intern_plugin_lock (lex, plugin_int_to_ref (pi->plugin ))))
28132813 var= NULL ; /* failed to lock it, it must be uninstalling */
@@ -2820,7 +2820,7 @@ sys_var *find_sys_var_ex(THD *thd, const char *str, size_t length,
28202820 }
28212821 }
28222822 else
2823- mysql_rwlock_unlock (&LOCK_system_variables_hash);
2823+ mysql_prlock_unlock (&LOCK_system_variables_hash);
28242824 if (!locked)
28252825 mysql_mutex_unlock (&LOCK_plugin);
28262826
@@ -3049,9 +3049,9 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
30493049 if (!thd->variables .dynamic_variables_ptr ||
30503050 (uint)offset > thd->variables .dynamic_variables_head )
30513051 {
3052- mysql_rwlock_rdlock (&LOCK_system_variables_hash);
3052+ mysql_prlock_rdlock (&LOCK_system_variables_hash);
30533053 sync_dynamic_session_variables (thd, global_lock);
3054- mysql_rwlock_unlock (&LOCK_system_variables_hash);
3054+ mysql_prlock_unlock (&LOCK_system_variables_hash);
30553055 }
30563056 DBUG_RETURN ((uchar*)thd->variables .dynamic_variables_ptr + offset);
30573057}
@@ -3166,7 +3166,7 @@ static void cleanup_variables(struct system_variables *vars)
31663166 st_bookmark *v;
31673167 uint idx;
31683168
3169- mysql_rwlock_rdlock (&LOCK_system_variables_hash);
3169+ mysql_prlock_rdlock (&LOCK_system_variables_hash);
31703170 for (idx= 0 ; idx < bookmark_hash.records ; idx++)
31713171 {
31723172 v= (st_bookmark*) my_hash_element (&bookmark_hash, idx);
@@ -3185,7 +3185,7 @@ static void cleanup_variables(struct system_variables *vars)
31853185 *ptr= NULL ;
31863186 }
31873187 }
3188- mysql_rwlock_unlock (&LOCK_system_variables_hash);
3188+ mysql_prlock_unlock (&LOCK_system_variables_hash);
31893189
31903190 DBUG_ASSERT (vars->table_plugin == NULL );
31913191 DBUG_ASSERT (vars->tmp_table_plugin == NULL );
@@ -4240,10 +4240,10 @@ int thd_key_create(MYSQL_THD_KEY_T *key)
42404240 PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_NOCMDOPT;
42414241 char namebuf[256 ];
42424242 snprintf (namebuf, sizeof (namebuf), " %u" , thd_key_no++);
4243- mysql_rwlock_wrlock (&LOCK_system_variables_hash);
4243+ mysql_prlock_wrlock (&LOCK_system_variables_hash);
42444244 // non-letters in the name as an extra safety
42454245 st_bookmark *bookmark= register_var (" \a\v\a\t\a\r " , namebuf, flags);
4246- mysql_rwlock_unlock (&LOCK_system_variables_hash);
4246+ mysql_prlock_unlock (&LOCK_system_variables_hash);
42474247 if (bookmark)
42484248 {
42494249 *key= bookmark->offset ;
0 commit comments