[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] fixed mutex unlock in mrn_db_open_or_create().

Back to archive index

Tetsuro IKEDA null+****@clear*****
Thu Oct 4 10:20:16 JST 2012


Tetsuro IKEDA	2010-03-25 11:10:56 +0900 (Thu, 25 Mar 2010)

  New Revision: cbea5e88780c319e1482abb61bd7bb9e12c68bb4
  https://github.com/mroonga/mroonga/commit/cbea5e88780c319e1482abb61bd7bb9e12c68bb4

  Log:
    fixed mutex unlock in mrn_db_open_or_create().

  Modified files:
    driver.c

  Modified: driver.c (+2 -0)
===================================================================
--- driver.c    2010-03-25 10:48:48 +0900 (5b4fc66)
+++ driver.c    2010-03-25 11:10:56 +0900 (db75e88)
@@ -648,6 +648,7 @@ int mrn_db_open_or_create(grn_ctx *ctx, mrn_info *info, mrn_object *obj)
       GRN_LOG(ctx, GRN_LOG_INFO, "database not found. creating...(%s)", db->path);
       obj->db = grn_db_create(ctx, db->path, NULL);
       if (obj->db == NULL) {
+        pthread_mutex_unlock(mrn_lock_db);
         GRN_LOG(ctx, GRN_LOG_ERROR, "cannot create database (%s)", db->path);
         return -1;
       }
@@ -655,6 +656,7 @@ int mrn_db_open_or_create(grn_ctx *ctx, mrn_info *info, mrn_object *obj)
       obj->db = grn_db_open(ctx, db->path);
       if (obj->db == NULL) {
         GRN_LOG(ctx, GRN_LOG_ERROR, "cannot open database (%s)", db->path);
+        pthread_mutex_unlock(mrn_lock_db);
         return -1;
       }
     }
-------------- next part --------------
HTML����������������������������...
Download 



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