1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Bug-fixes to get the two threadtest C programs working again. (CVS 1756)

FossilOrigin-Name: ffd3312b66e2657c3431eab814aadec254af2403
This commit is contained in:
danielk1977
2004-06-29 07:45:33 +00:00
parent 5fdae7711a
commit 2b444853e0
9 changed files with 84 additions and 30 deletions

View File

@ -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);
}