[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] minimal store_lock implementation.

Back to archive index

Tetsuro IKEDA null+****@clear*****
Thu Oct 4 10:18:21 JST 2012


Tetsuro IKEDA	2009-03-05 14:45:43 +0900 (Thu, 05 Mar 2009)

  New Revision: 2eade65147eb4b86b015937e0713db351a73e73c
  https://github.com/mroonga/mroonga/commit/2eade65147eb4b86b015937e0713db351a73e73c

  Log:
    minimal store_lock implementation.

  Modified files:
    src/ha_groonga.cc

  Modified: src/ha_groonga.cc (+8 -0)
===================================================================
--- src/ha_groonga.cc    2009-03-05 13:28:05 +0900 (9c504d2)
+++ src/ha_groonga.cc    2009-03-05 14:45:43 +0900 (95aa235)
@@ -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;
 }
@@ -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);
@@ -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;
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



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