diff options
author | danielk1977 <danielk1977@noemail.net> | 2007-08-29 12:31:25 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2007-08-29 12:31:25 +0000 |
commit | a1644fd86384de5f37fc42a7fb871a8c9a12dab5 (patch) | |
tree | ccd22487d7d42e8de86c109311e9d8aef043154a /src/test3.c | |
parent | 1fee73e74acab48412a3c596d4cd68deecadeef6 (diff) | |
download | sqlite-a1644fd86384de5f37fc42a7fb871a8c9a12dab5.tar.gz sqlite-a1644fd86384de5f37fc42a7fb871a8c9a12dab5.zip |
Modifications to the malloc failure tests to test transient and persistent failures. (CVS 4321)
FossilOrigin-Name: e38ef81b85feb5bff2ad8448f3438ff0ab36571e
Diffstat (limited to 'src/test3.c')
-rw-r--r-- | src/test3.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test3.c b/src/test3.c index fcfa37caf..d35efaab4 100644 --- a/src/test3.c +++ b/src/test3.c @@ -13,9 +13,10 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test3.c,v 1.82 2007/08/24 16:08:29 drh Exp $ +** $Id: test3.c,v 1.83 2007/08/29 12:31:28 danielk1977 Exp $ */ #include "sqliteInt.h" +#include "btreeInt.h" #include "tcl.h" #include <stdlib.h> #include <string.h> @@ -530,6 +531,7 @@ static int btree_pager_stats( return TCL_ERROR; } pBt = sqlite3TextToPtr(argv[1]); + sqlite3_mutex_enter(pBt->pSqlite->mutex); sqlite3BtreeEnter(pBt); a = sqlite3PagerStats(sqlite3BtreePager(pBt)); for(i=0; i<11; i++){ @@ -543,6 +545,7 @@ static int btree_pager_stats( Tcl_AppendElement(interp, zBuf); } sqlite3BtreeLeave(pBt); + sqlite3_mutex_leave(pBt->pSqlite->mutex); return TCL_OK; } @@ -1493,7 +1496,11 @@ static int btree_set_cache_size( } pBt = sqlite3TextToPtr(argv[1]); if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR; + + sqlite3_mutex_enter(pBt->pSqlite->mutex); sqlite3BtreeSetCacheSize(pBt, nCache); + sqlite3_mutex_leave(pBt->pSqlite->mutex); + return TCL_OK; } |