From 88439f06abf443a142257837ef2128d661ce639d Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 3 Jun 2013 11:34:05 +0700 Subject: [PATCH] #67 --- package.json | 6 +++--- tcejdb/configure | 18 +++++++++--------- tcejdb/configure.ac | 2 +- tcejdb/debian/changelog | 6 ++++++ tcejdb/tchdb.c | 30 ++++++++++-------------------- tcejdb/tcutil.h | 2 +- 6 files changed, 30 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index fa5bd18..dcadaf6 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name" : "ejdb", - "version" : "1.1.11-0", + "version" : "1.1.12-0", "config" : { - "windownloadurl_ia32" : "http://dl.dropboxusercontent.com/u/4709222/ejdb/tcejdb-1.1.11-mingw32-i686.zip", - "windownloadurl_x64" : "http://dl.dropboxusercontent.com/u/4709222/ejdb/tcejdb-1.1.11-mingw32-x86_64.zip" + "windownloadurl_ia32" : "http://dl.dropboxusercontent.com/u/4709222/ejdb/tcejdb-1.1.12-mingw32-i686.zip", + "windownloadurl_x64" : "http://dl.dropboxusercontent.com/u/4709222/ejdb/tcejdb-1.1.12-mingw32-x86_64.zip" }, "main" : "node/ejdb.js", "homepage" : "http://ejdb.org", diff --git a/tcejdb/configure b/tcejdb/configure index b2fd251..c7f163c 100755 --- a/tcejdb/configure +++ b/tcejdb/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tcejdb 1.1.11. +# Generated by GNU Autoconf 2.69 for tcejdb 1.1.12. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tcejdb' PACKAGE_TARNAME='tcejdb' -PACKAGE_VERSION='1.1.11' -PACKAGE_STRING='tcejdb 1.1.11' +PACKAGE_VERSION='1.1.12' +PACKAGE_STRING='tcejdb 1.1.12' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1268,7 +1268,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tcejdb 1.1.11 to adapt to many kinds of systems. +\`configure' configures tcejdb 1.1.12 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1333,7 +1333,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tcejdb 1.1.11:";; + short | recursive ) echo "Configuration of tcejdb 1.1.12:";; esac cat <<\_ACEOF @@ -1439,7 +1439,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tcejdb configure 1.1.11 +tcejdb configure 1.1.12 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1737,7 +1737,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tcejdb $as_me 1.1.11, which was +It was created by tcejdb $as_me 1.1.12, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -5273,7 +5273,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tcejdb $as_me 1.1.11, which was +This file was extended by tcejdb $as_me 1.1.12, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5326,7 +5326,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tcejdb config.status 1.1.11 +tcejdb config.status 1.1.12 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/tcejdb/configure.ac b/tcejdb/configure.ac index 6240bab..b256980 100644 --- a/tcejdb/configure.ac +++ b/tcejdb/configure.ac @@ -10,7 +10,7 @@ test -n "$CPPFLAGS" && MYCPPFLAGS="$CPPFLAGS $MYCPPFLAGS" test -n "$LDFLAGS" && MYLDFLAGS="$LDFLAGS $MYLDFLAGS" # Package name -AC_INIT(tcejdb, 1.1.11) +AC_INIT(tcejdb, 1.1.12) AC_CANONICAL_HOST # Package information diff --git a/tcejdb/debian/changelog b/tcejdb/debian/changelog index 0e683bb..461b7c2 100644 --- a/tcejdb/debian/changelog +++ b/tcejdb/debian/changelog @@ -1,3 +1,9 @@ +libtcejdb (1.1.12) testing; urgency=low + + * Threading consistency improvements + + -- Anton Adamansky Mon, 03 Jun 2013 11:32:15 +0700 + libtcejdb (1.1.10) testing; urgency=low * Threading consistency improvements diff --git a/tcejdb/tchdb.c b/tcejdb/tchdb.c index b838110..c21e642 100644 --- a/tcejdb/tchdb.c +++ b/tcejdb/tchdb.c @@ -899,7 +899,7 @@ bool tchdbiter2dispose(TCHDB *hdb, TCHDBITER* iter) { EJDB_EXPORT bool tchdbiter2next(TCHDB *hdb, TCHDBITER* iter, TCXSTR *kxstr, TCXSTR *vxstr) { assert(hdb && kxstr && vxstr && iter); - if (!HDBLOCKMETHOD(hdb, false)) return false; + if (!HDBLOCKMETHOD(hdb, true)) return false; if (INVALIDHANDLE(hdb->fd) || iter->pos < 1) { tchdbsetecode(hdb, TCEINVALID, __FILE__, __LINE__, __func__); HDBUNLOCKMETHOD(hdb); @@ -909,9 +909,7 @@ EJDB_EXPORT bool tchdbiter2next(TCHDB *hdb, TCHDBITER* iter, TCXSTR *kxstr, TCXS HDBUNLOCKMETHOD(hdb); return false; } - uint64_t pos = __atomic_load_n(&iter->pos, __ATOMIC_ACQUIRE); - bool rv = tchdbiternextintoxstr2(hdb, &pos, kxstr, vxstr); - __atomic_store_n(&iter->pos, pos, __ATOMIC_RELEASE); + bool rv = tchdbiternextintoxstr2(hdb, &iter->pos, kxstr, vxstr); HDBUNLOCKMETHOD(hdb); return rv; } @@ -2666,7 +2664,7 @@ static void tchdbfbpmerge(TCHDB *hdb) { if (hdb->iter2list) { for (int i = TCLISTNUM(hdb->iter2list) - 1; i >= 0; --i) { TCHDBITER **pit = TCLISTVALPTR(hdb->iter2list, i); - TCAS(&((*pit)->pos), next->off, next->off + next->rsiz); + if ((*pit)->pos == next->off) (*pit)->pos += next->rsiz; } } cur->rsiz += next->rsiz; @@ -2821,7 +2819,7 @@ static bool tchdbfbpsplice(TCHDB *hdb, TCHREC *rec, uint32_t nsiz) { if (hdb->iter2list) { for (int i = TCLISTNUM(hdb->iter2list) - 1; i >= 0; --i) { TCHDBITER **pit = TCLISTVALPTR(hdb->iter2list, i); - TCAS(&((*pit)->pos), pv->off, pv->off + pv->rsiz); + if ((*pit)->pos == pv->off) (*pit)->pos += pv->rsiz; } } rec->rsiz += pv->rsiz; @@ -2845,7 +2843,7 @@ static bool tchdbfbpsplice(TCHDB *hdb, TCHREC *rec, uint32_t nsiz) { if (hdb->iter2list) { for (int i = TCLISTNUM(hdb->iter2list) - 1; i >= 0; --i) { TCHDBITER **pit = TCLISTVALPTR(hdb->iter2list, i); - TCAS(&((*pit)->pos), nrec.off, nrec.off + nrec.rsiz); + if ((*pit)->pos == nrec.off) (*pit)->pos += nrec.rsiz; } } off += nrec.rsiz; @@ -4964,20 +4962,12 @@ static bool tchdbiternextintoxstr(TCHDB *hdb, TCXSTR *kxstr, TCXSTR *vxstr) { return tchdbiternextintoxstr2(hdb, &hdb->iter, kxstr, vxstr); } -/* #METHOD RWLOCK */ +/* #METHOD WLOCK */ static bool tchdbiternextintoxstr2(TCHDB *hdb, uint64_t *iter, TCXSTR *kxstr, TCXSTR *vxstr) { assert(hdb && kxstr && vxstr); TCHREC rec; char rbuf[HDBIOBUFSIZ]; - while (1) { - if (!HDBLOCKDB(hdb)) { //needed in the case of #METHOD WLOCK - return false; - } - if (*iter >= hdb->fsiz) { - HDBUNLOCKDB(hdb); - break; - } - HDBUNLOCKDB(hdb); + while (*iter < hdb->fsiz) { rec.off = *iter; if (!tchdbreadrec(hdb, &rec, rbuf)) { return false; @@ -5233,7 +5223,7 @@ static bool tchdbdefragimpl(TCHDB *hdb, int64_t step) { if (hdb->iter2list) { for (int i = TCLISTNUM(hdb->iter2list) - 1; i >= 0; --i) { TCHDBITER **pit = TCLISTVALPTR(hdb->iter2list, i); - TCAS(&((*pit)->pos), cur, cur + rec.rsiz); + if ((*pit)->pos == cur) (*pit)->pos += rec.rsiz; } } cur += rec.rsiz; @@ -5258,7 +5248,7 @@ static bool tchdbdefragimpl(TCHDB *hdb, int64_t step) { if (hdb->iter2list) { for (int i = TCLISTNUM(hdb->iter2list) - 1; i >= 0; --i) { TCHDBITER **pit = TCLISTVALPTR(hdb->iter2list, i); - TCAS(&((*pit)->pos), cur, dest); + if ((*pit)->pos == cur) (*pit)->pos = dest; } } dest += rec.rsiz; @@ -5268,7 +5258,7 @@ static bool tchdbdefragimpl(TCHDB *hdb, int64_t step) { if (hdb->iter2list) { for (int i = TCLISTNUM(hdb->iter2list) - 1; i >= 0; --i) { TCHDBITER **pit = TCLISTVALPTR(hdb->iter2list, i); - TCAS(&((*pit)->pos), cur, cur + rec.rsiz); + if ((*pit)->pos == cur) (*pit)->pos += rec.rsiz; } } fbsiz += rec.rsiz; diff --git a/tcejdb/tcutil.h b/tcejdb/tcutil.h index f2b5f8b..501a240 100644 --- a/tcejdb/tcutil.h +++ b/tcejdb/tcutil.h @@ -3726,7 +3726,7 @@ typedef unsigned char TCBITMAP; /* type of a bit map object */ #include -#define _TC_VERSION "1.1.11" +#define _TC_VERSION "1.1.12" #define _TC_LIBVER 911 #define _TC_FORMATVER "1.0" -- 2.7.4