[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: libsvn_wc, sqlite, and threads (gstein please read this)

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 14 Sep 2009 13:49:40 +0100

On Mon, Sep 14, 2009 at 12:51:19PM +0100, Stefan Sperling wrote:
> [[[
> * subversion/libsvn_subr/sqlite.c
> (init_sqlite): Wrap threading related-code in #if APR_HAS_THREADS.
> ]]]

Bert pointed out that the shared cache should also work in
single-threaded mode.

I'm running make check on this now.

Stefan

Index: subversion/libsvn_subr/sqlite.c
===================================================================
--- subversion/libsvn_subr/sqlite.c (revision 39293)
+++ subversion/libsvn_subr/sqlite.c (working copy)
@@ -648,6 +648,7 @@ init_sqlite(apr_pool_t *pool)
                     SQLITE_VERSION, sqlite3_libversion());
     }
 
+#if APR_HAS_THREADS
 #if SQLITE_VERSION_AT_LEAST(3,5,0)
   /* SQLite 3.5 allows verification of its thread-safety at runtime.
      Older versions are simply expected to have been configured with
@@ -669,10 +670,12 @@ init_sqlite(apr_pool_t *pool)
   }
   SQLITE_ERR_MSG(sqlite3_initialize(), _("Could not initialize SQLite"));
 #endif
+#endif /* APR_HAS_THRADS */
+
 #if SQLITE_VERSION_AT_LEAST(3,5,0)
- /* SQLite 3.5 allows sharing cache instances in a multithreaded environment.
- This allows sharing cached data when we open a database more than once
- (Very common in the current pre-single-database state) */
+ /* SQLite 3.5 allows sharing cache instances, even in a multithreaded
+ * environment. This allows sharing cached data when we open a database
+ * more than once (Very common in the current pre-single-database state) */
   SQLITE_ERR_MSG(sqlite3_enable_shared_cache(TRUE),
                  _("Could not initialize SQLite shared cache"));
 #endif

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2394598
Received on 2009-09-14 14:49:58 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.