[Groonga-commit] groonga/groonga at 3edde50 [master] grn_obj_lock grn_obj_unlock: support IO for chunk

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 27 11:46:20 JST 2016


Kouhei Sutou	2016-10-27 11:46:20 +0900 (Thu, 27 Oct 2016)

  New Revision: 3edde50ad6791f9b9e58721141bde070a1e1a6a0
  https://github.com/groonga/groonga/commit/3edde50ad6791f9b9e58721141bde070a1e1a6a0

  Message:
    grn_obj_lock grn_obj_unlock: support IO for chunk

  Modified files:
    lib/db.c

  Modified: lib/db.c (+6 -0)
===================================================================
--- lib/db.c    2016-10-27 11:40:55 +0900 (7358294)
+++ lib/db.c    2016-10-27 11:46:20 +0900 (8a6054d)
@@ -11128,6 +11128,9 @@ grn_obj_lock(grn_ctx *ctx, grn_obj *obj, grn_id id, int timeout)
   grn_rc rc = GRN_SUCCESS;
   GRN_API_ENTER;
   rc = grn_io_lock(ctx, grn_obj_io(obj), timeout);
+  if (rc == GRN_SUCCESS && obj && obj->header.type == GRN_COLUMN_INDEX) {
+    rc = grn_io_lock(ctx, ((grn_ii *)obj)->chunk, timeout);
+  }
   GRN_API_RETURN(rc);
 }
 
@@ -11136,6 +11139,9 @@ grn_obj_unlock(grn_ctx *ctx, grn_obj *obj, grn_id id)
 {
   GRN_API_ENTER;
   grn_io_unlock(grn_obj_io(obj));
+  if (obj && obj->header.type == GRN_COLUMN_INDEX) {
+    grn_io_unlock(((grn_ii *)obj)->chunk);
+  }
   GRN_API_RETURN(GRN_SUCCESS);
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index