/ Check-in [95292408]
Login
Overview
Comment:Fix some minor problems with the new test4.c module used for doing thread testing. (CVS 1142)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:952924084aac4a7fa84a7cb7aaac869d35db1896
User & Date: drh 2003-12-20 04:00:53
Context
2003-12-22
14:53
Optimizations to the LEMON parser template. (CVS 1143) check-in: 06db29df user: drh tags: trunk
2003-12-20
04:00
Fix some minor problems with the new test4.c module used for doing thread testing. (CVS 1142) check-in: 95292408 user: drh tags: trunk
2003-12-19
20:09
Update configuration and make files for mingw/msys on Windows (CVS 1141) check-in: 1e968967 user: dougcurrie tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test4.c.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
134
135
136
137
138
139
140

141
142
143
144
145
146
147
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Code for testing the the SQLite library in a multithreaded environment.
**
** $Id: test4.c,v 1.1 2003/12/19 02:52:09 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(OS_UNIX) && defined(THREADSAFE) && THREADSAFE==1
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <sched.h>
#include <ctype.h>

/*
................................................................................
    Tcl_AppendResult(interp, "thread ", argv[1], " is already running", 0);
    return TCL_ERROR;
  }
  threadset[i].busy = 1;
  sqliteFree(threadset[i].zFilename);
  threadset[i].zFilename = sqliteStrDup(argv[2]);
  threadset[i].opnum = 1;

  rc = pthread_create(&x, 0, thread_main, &threadset[i]);
  if( rc ){
    Tcl_AppendResult(interp, "failed to create the thread", 0);
    sqliteFree(threadset[i].zFilename);
    threadset[i].busy = 0;
    return TCL_ERROR;
  }







|



|







 







>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Code for testing the the SQLite library in a multithreaded environment.
**
** $Id: test4.c,v 1.2 2003/12/20 04:00:53 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(OS_UNIX) && OS_UNIX==1 && defined(THREADSAFE) && THREADSAFE==1
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <sched.h>
#include <ctype.h>

/*
................................................................................
    Tcl_AppendResult(interp, "thread ", argv[1], " is already running", 0);
    return TCL_ERROR;
  }
  threadset[i].busy = 1;
  sqliteFree(threadset[i].zFilename);
  threadset[i].zFilename = sqliteStrDup(argv[2]);
  threadset[i].opnum = 1;
  threadset[i].completed = 0;
  rc = pthread_create(&x, 0, thread_main, &threadset[i]);
  if( rc ){
    Tcl_AppendResult(interp, "failed to create the thread", 0);
    sqliteFree(threadset[i].zFilename);
    threadset[i].busy = 0;
    return TCL_ERROR;
  }