diff options
author | danielk1977 <danielk1977@noemail.net> | 2004-06-29 07:45:33 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2004-06-29 07:45:33 +0000 |
commit | 2b444853e0434025184cafd3cde0cf0a35d5409d (patch) | |
tree | c26eb465aeb121ad94a3e191aded350d1e3a9cc4 /test/threadtest1.c | |
parent | 5fdae7711a2fb3b367dba5b740fc0827f658ef5a (diff) | |
download | sqlite-2b444853e0434025184cafd3cde0cf0a35d5409d.tar.gz sqlite-2b444853e0434025184cafd3cde0cf0a35d5409d.zip |
Bug-fixes to get the two threadtest C programs working again. (CVS 1756)
FossilOrigin-Name: ffd3312b66e2657c3431eab814aadec254af2403
Diffstat (limited to 'test/threadtest1.c')
-rw-r--r-- | test/threadtest1.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/threadtest1.c b/test/threadtest1.c index f5ff112e6..56fcce33e 100644 --- a/test/threadtest1.c +++ b/test/threadtest1.c @@ -262,7 +262,16 @@ int main(int argc, char **argv){ } for(i=0; i<n; i++){ zFile = sqlite3_mprintf("%d.testdb-%d", i%2+1, (i+2)/2); - unlink(zFile); + if( (i%2)==0 ){ + /* Remove both the database file and any old journal for the file + ** being used by this thread and the next one. */ + char *zDb = &zFile[2]; + char *zJournal = sqlite3_mprintf("%s-journal", zDb); + unlink(zDb); + unlink(zJournal); + free(zJournal); + } + pthread_create(&id, 0, worker_bee, (void*)zFile); pthread_detach(id); } |