[elephant-cvs] CVS update: elephant/src/libsleepycat.c

blee at common-lisp.net blee at common-lisp.net
Thu Sep 2 14:45:55 UTC 2004


Update of /project/elephant/cvsroot/elephant/src
In directory common-lisp.net:/tmp/cvs-serv31060/src

Modified Files:
	libsleepycat.c 
Log Message:
next-oid fix: bug in counters, they weren't using the parent
transactions and so were dead locking inside of with-transactions

Date: Thu Sep  2 16:45:53 2004
Author: blee

Index: elephant/src/libsleepycat.c
diff -u elephant/src/libsleepycat.c:1.6 elephant/src/libsleepycat.c:1.7
--- elephant/src/libsleepycat.c:1.6	Sun Aug 29 22:39:29 2004
+++ elephant/src/libsleepycat.c	Thu Sep  2 16:45:53 2004
@@ -416,7 +416,8 @@
 
 /* Poor man's counters */
 
-int next_counter(DB_ENV *env, DB *db, char *key, u_int32_t key_length,
+int next_counter(DB_ENV *env, DB *db, DB_TXN *parent,
+		 char *key, u_int32_t key_length,
 		 char *lockid, u_int32_t lockid_length) {
   DB_LOCK lock;
   DBT DBTKey, DBTData; 
@@ -439,7 +440,7 @@
   lockheld = 0;
 
   /* Begin the transaction. */ 
-  if ((ret = env->txn_begin(env, NULL, &tid, 0)) != 0) { 
+  if ((ret = env->txn_begin(env, parent, &tid, 0)) != 0) { 
     env->err(env, ret, "DB_ENV->txn_begin"); 
     return (-1); 
   }





More information about the Elephant-cvs mailing list