1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-02 05:54:29 +03:00

Get the quick.test script running with SQLITE_THREADSAFE enabled. (CVS 4269)

FossilOrigin-Name: 1f28b7e47bba221c14a10a37e7425c9975bb2312
This commit is contained in:
drh
2007-08-22 11:41:18 +00:00
parent c7b6017c8a
commit cab5ed7a57
6 changed files with 35 additions and 39 deletions

View File

@@ -12,7 +12,7 @@
** Code for testing the client/server version of the SQLite library.
** Derived from test4.c.
**
** $Id: test7.c,v 1.7 2007/08/21 10:44:16 drh Exp $
** $Id: test7.c,v 1.8 2007/08/22 11:41:18 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -163,14 +163,14 @@ static int tcl_client_create(
return TCL_ERROR;
}
threadset[i].busy = 1;
sqliteFree(threadset[i].zFilename);
sqlite3_free(threadset[i].zFilename);
threadset[i].zFilename = sqlite3StrDup(argv[2]);
threadset[i].opnum = 1;
threadset[i].completed = 0;
rc = pthread_create(&x, 0, client_main, &threadset[i]);
if( rc ){
Tcl_AppendResult(interp, "failed to create the thread", 0);
sqliteFree(threadset[i].zFilename);
sqlite3_free(threadset[i].zFilename);
threadset[i].busy = 0;
return TCL_ERROR;
}
@@ -222,9 +222,9 @@ static void stop_thread(Thread *p){
p->xOp = 0;
p->opnum++;
client_wait(p);
sqliteFree(p->zArg);
sqlite3_free(p->zArg);
p->zArg = 0;
sqliteFree(p->zFilename);
sqlite3_free(p->zFilename);
p->zFilename = 0;
p->busy = 0;
}
@@ -506,7 +506,7 @@ static int tcl_client_compile(
}
client_wait(&threadset[i]);
threadset[i].xOp = do_compile;
sqliteFree(threadset[i].zArg);
sqlite3_free(threadset[i].zArg);
threadset[i].zArg = sqlite3StrDup(argv[2]);
threadset[i].opnum++;
return TCL_OK;
@@ -601,7 +601,7 @@ static int tcl_client_finalize(
}
client_wait(&threadset[i]);
threadset[i].xOp = do_finalize;
sqliteFree(threadset[i].zArg);
sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0;
threadset[i].opnum++;
return TCL_OK;
@@ -645,7 +645,7 @@ static int tcl_client_reset(
}
client_wait(&threadset[i]);
threadset[i].xOp = do_reset;
sqliteFree(threadset[i].zArg);
sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0;
threadset[i].opnum++;
return TCL_OK;