/ Check-in [b70bccca]
Login

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

Overview
Comment:Modify the test_quote.c demonstration shim so that it works when SQLITE_THREADSAFE=0 is defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b70bcccaf5597c8a59cccb64fb997523f7b8fe4f
User & Date: drh 2011-01-24 20:18:05
Context
2011-01-25
04:34
Shave a few cycles so that performance is better than 3.7.4 in speed tests. check-in: e1464930 user: drh tags: trunk
2011-01-24
20:18
Modify the test_quote.c demonstration shim so that it works when SQLITE_THREADSAFE=0 is defined. check-in: b70bccca user: drh tags: trunk
19:45
Fix a typo in the documentation for sqlite3_snprintf(). No changes to code. check-in: 8d106541 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_quota.c.

    26     26   ** callback does enlarge the quota such that the total size of all
    27     27   ** files within the group is less than the new quota, then the write
    28     28   ** continues as if nothing had happened.
    29     29   */
    30     30   #include "sqlite3.h"
    31     31   #include <string.h>
    32     32   #include <assert.h>
           33  +
           34  +/*
           35  +** For an build without mutexes, no-op the mutex calls.
           36  +*/
           37  +#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE==0
           38  +#define sqlite3_mutex_alloc(X)    ((sqlite3_mutex*)8)
           39  +#define sqlite3_mutex_free(X)
           40  +#define sqlite3_mutex_enter(X)
           41  +#define sqlite3_mutex_try(X)      SQLITE_OK
           42  +#define sqlite3_mutex_leave(X)
           43  +#define sqlite3_mutex_held(X)     ((void)(X),1)
           44  +#define sqlite3_mutex_notheld(X)  ((void)(X),1)
           45  +#endif /* SQLITE_THREADSAFE==0 */
           46  +
    33     47   
    34     48   /************************ Object Definitions ******************************/
    35     49   
    36     50   /* Forward declaration of all object types */
    37     51   typedef struct quotaGroup quotaGroup;
    38     52   typedef struct quotaConn quotaConn;
    39     53   typedef struct quotaFile quotaFile;