1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Begin adding mutexes. Compiles without SQLITE_OMIT_SHARED_CACHE but we

get an assertion fault on the shared cache testing. (CVS 4239)

FossilOrigin-Name: 4c1e9ffebe7c611a8b6a89153ae97ab9bca19ea3
This commit is contained in:
drh
2007-08-17 01:14:38 +00:00
parent 6bdec4afb4
commit e53831d644
13 changed files with 449 additions and 219 deletions

View File

@@ -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.382 2007/08/16 13:01:45 drh Exp $
** $Id: main.c,v 1.383 2007/08/17 01:14:38 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -1235,35 +1235,6 @@ int sqlite3Corrupt(void){
}
#endif
#ifndef SQLITE_OMIT_SHARED_CACHE
/*
** Enable or disable the shared pager and schema features for the
** current thread.
**
** This routine should only be called when there are no open
** database connections.
*/
int sqlite3_enable_shared_cache(int enable){
ThreadData *pTd = sqlite3ThreadData();
if( pTd ){
/* It is only legal to call sqlite3_enable_shared_cache() when there
** are no currently open b-trees that were opened by the calling thread.
** This condition is only easy to detect if the shared-cache were
** previously enabled (and is being disabled).
*/
if( pTd->pBtree && !enable ){
assert( pTd->useSharedData );
return SQLITE_MISUSE;
}
pTd->useSharedData = enable;
/* sqlite3ReleaseThreadData(); */
}
return sqlite3ApiExit(0, SQLITE_OK);
}
#endif
/*
** This is a convenience routine that makes sure that all thread-specific
** data for this thread has been deallocated.