/ Check-in [8b318b93]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In test_mutex.c, zero the global structure staticly instead of in Sqlitetest_mutex_Init(). This is because Sqlitetest_mutex_Init() is now called by each thread during thread tests ((6193)). Test code changes only. (CVS 6279)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8b318b9385d0542ca56750b901c0c6b7d05ca634
User & Date: danielk1977 2009-02-11 05:18:07
Context
2009-02-11
07:38
Modify the test_journal.c code to (1) account for the backup code writing to parts of the pending-byte page when changing a databases page-size, and (2) to avoid reading from the pending-byte page and triggering the assert in os_unix.c. Changes to test code only. (CVS 6280) check-in: 48796216 user: danielk1977 tags: trunk
05:18
In test_mutex.c, zero the global structure staticly instead of in Sqlitetest_mutex_Init(). This is because Sqlitetest_mutex_Init() is now called by each thread during thread tests ((6193)). Test code changes only. (CVS 6279) check-in: 8b318b93 user: danielk1977 tags: trunk
2009-02-10
18:54
For the "onefile" demo, pass SQLITE_OPEN_TEMP_DB instead of MAIN_DB to the OS layer when opening the single file. This is to work around the assert() in os_unix.c that tests that the locking region is not written to. (CVS 6278) check-in: 2da076a2 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_mutex.c.

     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** 
    13         -** $Id: test_mutex.c,v 1.13 2009/01/19 17:40:12 drh Exp $
           13  +** $Id: test_mutex.c,v 1.14 2009/02/11 05:18:07 danielk1977 Exp $
    14     14   */
    15     15   
    16     16   #include "tcl.h"
    17     17   #include "sqlite3.h"
    18     18   #include "sqliteInt.h"
    19     19   #include <stdlib.h>
    20     20   #include <assert.h>
................................................................................
    34     34     int isInstalled;              /* True if installed */
    35     35     int disableInit;              /* True to cause sqlite3_initalize() to fail */
    36     36     int disableTry;               /* True to force sqlite3_mutex_try() to fail */
    37     37     int isInit;                   /* True if initialized */
    38     38     sqlite3_mutex_methods m;      /* Interface to "real" mutex system */
    39     39     int aCounter[8];              /* Number of grabs of each type of mutex */
    40     40     sqlite3_mutex aStatic[6];     /* The six static mutexes */
    41         -} g;
           41  +} g = {0};
    42     42   
    43     43   /* Return true if the countable mutex is currently held */
    44     44   static int counterMutexHeld(sqlite3_mutex *p){
    45     45     return g.m.xMutexHeld(p->pReal);
    46     46   }
    47     47   
    48     48   /* Return true if the countable mutex is not currently held */
................................................................................
   427    427       { "read_mutex_counters",     (Tcl_ObjCmdProc*)test_read_mutex_counters },
   428    428       { "clear_mutex_counters",    (Tcl_ObjCmdProc*)test_clear_mutex_counters },
   429    429     };
   430    430     int i;
   431    431     for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
   432    432       Tcl_CreateObjCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
   433    433     }
   434         -  memset(&g, 0, sizeof(g));
   435    434   
   436    435     Tcl_LinkVar(interp, "disable_mutex_init", 
   437    436                 (char*)&g.disableInit, TCL_LINK_INT);
   438    437     Tcl_LinkVar(interp, "disable_mutex_try", 
   439    438                 (char*)&g.disableTry, TCL_LINK_INT);
   440    439     return SQLITE_OK;
   441    440   }