~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_plugin.cc

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
710
710
    plugin_dl_del(&plugin->plugin_dl->dl);
711
711
  plugin->state= PLUGIN_IS_FREED;
712
712
  plugin_array_version++;
713
 
  rw_wrlock(&LOCK_system_variables_hash);
 
713
  pthread_rwlock_wrlock(&LOCK_system_variables_hash);
714
714
  mysql_del_sys_var_chain(plugin->system_vars);
715
 
  rw_unlock(&LOCK_system_variables_hash);
 
715
  pthread_rwlock_unlock(&LOCK_system_variables_hash);
716
716
  free_root(&plugin->mem_root, MYF(0));
717
717
  return;
718
718
}
1621
1621
  sys_var_pluginvar *pi= NULL;
1622
1622
  plugin_ref plugin;
1623
1623
 
1624
 
  rw_rdlock(&LOCK_system_variables_hash);
 
1624
  pthread_rwlock_rdlock(&LOCK_system_variables_hash);
1625
1625
  if ((var= intern_find_sys_var(str, length, false)) &&
1626
1626
      (pi= var->cast_pluginvar()))
1627
1627
  {
1628
 
    rw_unlock(&LOCK_system_variables_hash);
 
1628
    pthread_rwlock_unlock(&LOCK_system_variables_hash);
1629
1629
    LEX *lex= session ? session->lex : 0;
1630
1630
    if (!(plugin= my_intern_plugin_lock(lex, plugin_int_to_ref(pi->plugin))))
1631
1631
      var= NULL; /* failed to lock it, it must be uninstalling */
1638
1638
    }
1639
1639
  }
1640
1640
  else
1641
 
    rw_unlock(&LOCK_system_variables_hash);
 
1641
    pthread_rwlock_unlock(&LOCK_system_variables_hash);
1642
1642
 
1643
1643
  /*
1644
1644
    If the variable exists but the plugin it is associated with is not ready
1816
1816
  {
1817
1817
    uint32_t idx;
1818
1818
 
1819
 
    rw_rdlock(&LOCK_system_variables_hash);
 
1819
    pthread_rwlock_rdlock(&LOCK_system_variables_hash);
1820
1820
 
1821
1821
    session->variables.dynamic_variables_ptr= (char*)
1822
1822
      my_realloc(session->variables.dynamic_variables_ptr,
1874
1874
    session->variables.dynamic_variables_size=
1875
1875
           global_system_variables.dynamic_variables_size;
1876
1876
 
1877
 
    rw_unlock(&LOCK_system_variables_hash);
 
1877
    pthread_rwlock_unlock(&LOCK_system_variables_hash);
1878
1878
  }
1879
1879
  return (unsigned char*)session->variables.dynamic_variables_ptr + offset;
1880
1880
}
1961
1961
  int flags;
1962
1962
  uint32_t idx;
1963
1963
 
1964
 
  rw_rdlock(&LOCK_system_variables_hash);
 
1964
  pthread_rwlock_rdlock(&LOCK_system_variables_hash);
1965
1965
  for (idx= 0; idx < bookmark_hash.records; idx++)
1966
1966
  {
1967
1967
    v= (st_bookmark*) hash_element(&bookmark_hash, idx);
1981
1981
      *ptr= NULL;
1982
1982
    }
1983
1983
  }
1984
 
  rw_unlock(&LOCK_system_variables_hash);
 
1984
  pthread_rwlock_unlock(&LOCK_system_variables_hash);
1985
1985
 
1986
1986
  assert(vars->table_plugin == NULL);
1987
1987