]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix btree.c so that it works with -DSQLITE_THREADSAFE=0 and -DSQLITE_DEBUG=1 (CVS...
authordrh <drh@noemail.net>
Mon, 3 Sep 2007 22:00:39 +0000 (22:00 +0000)
committerdrh <drh@noemail.net>
Mon, 3 Sep 2007 22:00:39 +0000 (22:00 +0000)
FossilOrigin-Name: fee2d7c0e6d34dd19ff5f7631c1743879068c8ce

main.mk
manifest
manifest.uuid
src/btree.c

diff --git a/main.mk b/main.mk
index 7f2cabf98f400be5c49aefbd57f4eb9b3a46e2c4..1d67c59be86f35b724339a199bcc68d721944ed5 100644 (file)
--- a/main.mk
+++ b/main.mk
@@ -9,13 +9,6 @@
 # BCC              C Compiler and options for use in building executables that
 #                  will run on the platform that is doing the build.
 #
-# USLEEP           If the target operating system supports the "usleep()" system
-#                  call, then define the HAVE_USLEEP macro for all C modules.
-#
-# THREADSAFE       If you want the SQLite library to be safe for use within a 
-#                  multi-threaded program, then define the following macro
-#                  appropriately:
-#
 # THREADLIB        Specify any extra linker options needed to make the library
 #                  thread safe
 #
@@ -51,7 +44,7 @@
 
 # This is how we compile
 #
-TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src
+TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src
 
 # Object files for the SQLite library.
 #
index 5c715301531619c80d6db53bbb50219eb63b9a85..e50b34cab3cd28206672c29db73d4618d8f27d2b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Documentation\supdates\sin\spreparation\sfor\sthe\srelease\sof\sversion\s3.5.0.\s(CVS\s4386)
-D 2007-09-03T20:32:45
+C Fix\sbtree.c\sso\sthat\sit\sworks\swith\s-DSQLITE_THREADSAFE=0\sand\s-DSQLITE_DEBUG=1\s(CVS\s4387)
+D 2007-09-03T22:00:39
 F Makefile.in f3460f3363dd568c950a62f93e97eb19f6d069d8
 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -63,7 +63,7 @@ F ext/icu/README.txt 3b130aa66e7a681136f6add198b076a2f90d1e33
 F ext/icu/icu.c 61a345d8126686aa3487aa8d2d0f68abd655f7a4
 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895
 F ltmain.sh 56abb507100ed2d4261f6dd1653dec3cf4066387
-F main.mk ce638342ef19844812eaade3b8a944709bb2813e
+F main.mk 236865e8cb89db59b913ee4b28326e67dfda3c53
 F mkdll.sh 37fa8a7412e51b5ab2bc6d4276135f022a0feffb
 F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
 F mkextw.sh 1a866b53637dab137191341cc875575a5ca110fb
@@ -81,7 +81,7 @@ F src/analyze.c 49b4bd45eb286d833793ed6bf72355a5c1974865
 F src/attach.c 02fd8779270b1df1c63e7ba6e6655b960fa0f3d5
 F src/auth.c d41c34f3150b3b8248d364770ef922bbcefbff82
 F src/btmutex.c 442be6f068d77ca9ffd69899cf0a3943c244548c
-F src/btree.c bc7d856505b12f903966d1fd87165588ac7a961b
+F src/btree.c b1e8025ac1ba81d78c2d2bab47af8efd1d143995
 F src/btree.h d0736ebca4b6eafbdd823c46a8de574cea078211
 F src/btreeInt.h 4330c19b8314545fdb209cc77e2a57f6a5290e9c
 F src/build.c 94d0d6dfd1e706c480903fbdda2e77466f21b898
@@ -569,7 +569,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 51726a9bb6c7f98c496302745656dc317ad5c094
-R b6337e684a5d9067ca7a33a3860add13
+P c6809bf77625f420ac62513635628ff4f1766f83
+R 7ec7f5bd5ba036194f3de9124caa4922
 U drh
-Z bffd337f01056c4ca53d6f1685390e4f
+Z 0685daa71fde16dce4df6f8f549f50de
index b863058bd6162a8f518e0e34b2cd19abc713c17f..e931e98a19a624270cc61d56ceaf37aae419cf18 100644 (file)
@@ -1 +1 @@
-c6809bf77625f420ac62513635628ff4f1766f83
\ No newline at end of file
+fee2d7c0e6d34dd19ff5f7631c1743879068c8ce
\ No newline at end of file
index 2f81d41154804bcc8676c7b9d9fd3af4259f0b0d..c56518b7803298822af48a9d02978a7fcc9e9684 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.421 2007/09/03 15:19:35 drh Exp $
+** $Id: btree.c,v 1.422 2007/09/03 22:00:39 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -1267,11 +1267,13 @@ int sqlite3BtreeOpen(
       sqlite3_mutex *mutexShared;
       pBt->nRef = 1;
       mutexShared = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER);
-      pBt->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
-      if( pBt->mutex==0 ){
-        rc = SQLITE_NOMEM;
-        pSqlite->mallocFailed = 0;
-        goto btree_open_out;
+      if( SQLITE_THREADSAFE ){
+        pBt->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
+        if( pBt->mutex==0 ){
+          rc = SQLITE_NOMEM;
+          pSqlite->mallocFailed = 0;
+          goto btree_open_out;
+        }
       }
       sqlite3_mutex_enter(mutexShared);
       pBt->pNext = sqlite3SharedCacheList;
@@ -1354,7 +1356,9 @@ static int removeFromSharingList(BtShared *pBt){
         pList->pNext = pBt->pNext;
       }
     }
-    sqlite3_mutex_free(pBt->mutex);
+    if( SQLITE_THREADSAFE ){
+      sqlite3_mutex_free(pBt->mutex);
+    }
     removed = 1;
   }
   sqlite3_mutex_leave(pMaster);