Fix a problem with threads and the global database list in main.c. (CVS 2434)

FossilOrigin-Name: 4aa05d2251b0cf6323ea695330de9ccf7e071bed
diff --git a/manifest b/manifest
index 9c532da..a3753cb 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Version\s3.2.1\s(CVS\s2433)
-D 2005-03-29T13:37:46
+C Fix\sa\sproblem\swith\sthreads\sand\sthe\sglobal\sdatabase\slist\sin\smain.c.\s(CVS\s2434)
+D 2005-03-29T23:34:58
 F Makefile.in 5c00d0037104de2a50ac7647a5f12769795957a3
 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -42,7 +42,7 @@
 F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84
 F src/insert.c 34c25c33f51a43644a42cc091ac967b070c6b6d5
 F src/legacy.c d58ea507bce885298a2c8c3cbb0f4bff5d47830b
-F src/main.c 531fab947f72d3b6e86476ed4594838a2fa277f5
+F src/main.c 336ab4bf0e398471a0607875f9b90b698b49ce92
 F src/md5.c 7ae1c39044b95de2f62e066f47bb1deb880a1070
 F src/os.h 0c805df3df02b98eb78a7a86756c3cbd4e190939
 F src/os_common.h 0e7f428ba0a6c40a61bc56c4e96f493231301b73
@@ -278,7 +278,7 @@
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl 528299b8316726dbcc5548e9aa0648c8b1bd055b
-P afa42e2fa4487e4671ee481df09659a447f9c2a8
-R 033dbae23f2b3e90549460ac03d826a9
-U drh
-Z cf6dcb13b78bca9d8e0428ebc0ec39f2
+P 844f01af726f5e478a4ef32f39be9f20360a0d96
+R 1c3790c82c48862642a6dbd8402d2f28
+U danielk1977
+Z cea0fd35b8cef97f59b2f45aa29f11bc
diff --git a/manifest.uuid b/manifest.uuid
index cf8e535..37104ba 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-844f01af726f5e478a4ef32f39be9f20360a0d96
\ No newline at end of file
+4aa05d2251b0cf6323ea695330de9ccf7e071bed
\ No newline at end of file
diff --git a/src/main.c b/src/main.c
index 20335a0..42a031c6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.284 2005/03/29 03:10:59 danielk1977 Exp $
+** $Id: main.c,v 1.285 2005/03/29 23:34:58 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -531,8 +531,9 @@
 
 #ifndef SQLITE_OMIT_GLOBALRECOVER
   {
-    sqlite3 *pPrev = pDbList;
+    sqlite3 *pPrev;
     sqlite3OsEnterMutex();
+    pPrev = pDbList;
     while( pPrev && pPrev->pNext!=db ){
       pPrev = pPrev->pNext;
     }