Navigation Menu

Skip to content

Commit

Permalink
minimal store_lock implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikdttr committed Mar 5, 2009
1 parent 3320919 commit 2eade65
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ha_groonga.cc
Expand Up @@ -215,9 +215,12 @@ int ha_groonga::open(const char *name, int mode, uint test_if_locked)
}
share->field[i] = NULL;

thr_lock_init(&share->lock);

mrn_share_put(share);
this->share = share;
}
thr_lock_data_init(&share->lock, &lock, NULL);
share->use_count++;
return 0;
}
Expand All @@ -232,6 +235,8 @@ int ha_groonga::close()
MRN_LOG(GRN_LOG_DEBUG, "-> grn_obj_close: '%s'", share->name);
grn_obj_close(mrn_ctx_tls, share->obj);

thr_lock_delete(&share->lock);

mrn_field **field;
for (field = share->field; *field; field++) {
MRN_FREE(*field);
Expand All @@ -255,6 +260,9 @@ THR_LOCK_DATA **ha_groonga::store_lock(THD *thd,
{
mrn_ctx_init();
MRN_TRACE;
if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK)
lock.type = lock_type;
*to++= &lock;
return to;
}

Expand Down

0 comments on commit 2eade65

Please sign in to comment.