readd lock around f'n

git-svn-id: file:///svn/mysql/tokudb-engine/src@4942 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Zardosht Kasheff 2008-07-04 16:34:36 +00:00 committed by Yoni Fogel
parent 61612cdcf3
commit f5f6715103

View file

@ -1735,6 +1735,7 @@ int ha_tokudb::read_last() {
//
void ha_tokudb::init_hidden_prim_key_info() {
TOKUDB_DBUG_ENTER("ha_tokudb::init_prim_key_info");
pthread_mutex_lock(&share->mutex);
if (!(share->status & STATUS_PRIMARY_KEY_INIT)) {
(void) extra(HA_EXTRA_KEYREAD);
int error = read_last();
@ -1755,6 +1756,7 @@ void ha_tokudb::init_hidden_prim_key_info() {
share->status |= STATUS_PRIMARY_KEY_INIT;
}
pthread_mutex_unlock(&share->mutex);
DBUG_VOID_RETURN;
}