Navigation Menu

Skip to content

Commit

Permalink
Add missing lock
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 16, 2015
1 parent 06e3448 commit 2cf68de
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/conf.c
Expand Up @@ -60,7 +60,18 @@ grn_conf_set(grn_ctx *ctx,
}

conf = ((grn_db *)db)->conf;
id = grn_hash_add(ctx, conf, key, key_size, &packed_value, NULL);
{
grn_rc rc;
rc = grn_io_lock(ctx, conf->io, grn_lock_timeout);
if (rc != GRN_SUCCESS) {
if (ctx->rc == GRN_SUCCESS) {
ERR(rc, "[conf][set] failed to lock");
}
GRN_API_RETURN(rc);
}
id = grn_hash_add(ctx, conf, key, key_size, &packed_value, NULL);
grn_io_unlock(conf->io);
}
if (id == GRN_ID_NIL && ctx->rc == GRN_SUCCESS) {
ERR(GRN_INVALID_ARGUMENT,
"[conf][set] failed to set: name=<%.*s>: <%d>",
Expand Down

0 comments on commit 2cf68de

Please sign in to comment.