[Groonga-commit] groonga/groonga at 7a89fde [master] grn_obj_is_locked: check also specs and config for DB

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Mar 28 15:23:50 JST 2018


Kouhei Sutou	2018-03-28 15:23:50 +0900 (Wed, 28 Mar 2018)

  New Revision: 7a89fde7f24388519fd73b597c683a09afb66dbe
  https://github.com/groonga/groonga/commit/7a89fde7f24388519fd73b597c683a09afb66dbe

  Message:
    grn_obj_is_locked: check also specs and config for DB

  Modified files:
    lib/db.c

  Modified: lib/db.c (+15 -2)
===================================================================
--- lib/db.c    2018-03-28 15:15:54 +0900 (950a37021)
+++ lib/db.c    2018-03-28 15:23:50 +0900 (f3bf607d8)
@@ -11591,8 +11591,21 @@ grn_obj_is_locked(grn_ctx *ctx, grn_obj *obj)
   unsigned int res = 0;
   GRN_API_ENTER;
   res = grn_io_is_locked(grn_obj_get_io(ctx, obj));
-  if (obj && obj->header.type == GRN_COLUMN_INDEX) {
-    res += grn_io_is_locked(((grn_ii *)obj)->chunk);
+  if (obj) {
+    switch (obj->header.type) {
+    case GRN_DB:
+      {
+        grn_db *db = (grn_db *)obj;
+        if (db->specs) {
+          res += grn_obj_is_locked(ctx, (grn_obj *)(db->specs));
+        }
+        res += grn_obj_is_locked(ctx, (grn_obj *)db->config);
+      }
+      break;
+    case GRN_COLUMN_INDEX:
+      res += grn_io_is_locked(((grn_ii *)obj)->chunk);
+      break;
+    }
   }
   GRN_API_RETURN(res);
 }
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180328/590c78f3/attachment.htm 



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