SQLite

Check-in [8b23b71944]
Login

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

Overview
Comment:Add a call to sqlite3_initialize() to sqlite3_mutex_alloc() (CVS 5236)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8b23b719440aca9fca7e8f409729c3318ff3f80c
User & Date: danielk1977 2008-06-18 18:08:39.000
Context
2008-06-18
18:12
Added support for scratch-memory lookaside allocations. Largely untested. Added calls to sqlite3_initialize() within malloc APIs. (CVS 5237) (check-in: 383a78601c user: drh tags: trunk)
18:08
Add a call to sqlite3_initialize() to sqlite3_mutex_alloc() (CVS 5236) (check-in: 8b23b71944 user: danielk1977 tags: trunk)
17:59
Fix a test case in mutex1.test that was failing when sqlite was compiled with SQLITE_THREADSAFE=0. (CVS 5235) (check-in: d1a87c3bcc user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/mutex.c.
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
** exclusion and is thus suitable for use only in applications
** that use SQLite in a single thread.  But this implementation
** does do a lot of error checking on mutexes to make sure they
** are called correctly and at appropriate times.  Hence, this
** implementation is suitable for testing.
** debugging purposes
**
** $Id: mutex.c,v 1.24 2008/06/18 17:09:10 danielk1977 Exp $
*/
#include "sqliteInt.h"

#ifndef SQLITE_MUTEX_NOOP
/*
** Initialize the mutex system.
*/







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
** exclusion and is thus suitable for use only in applications
** that use SQLite in a single thread.  But this implementation
** does do a lot of error checking on mutexes to make sure they
** are called correctly and at appropriate times.  Hence, this
** implementation is suitable for testing.
** debugging purposes
**
** $Id: mutex.c,v 1.25 2008/06/18 18:08:39 danielk1977 Exp $
*/
#include "sqliteInt.h"

#ifndef SQLITE_MUTEX_NOOP
/*
** Initialize the mutex system.
*/
76
77
78
79
80
81
82



83
84
85
86
87
88
89
  return rc;
}

/*
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
*/
sqlite3_mutex *sqlite3_mutex_alloc(int id){



  return sqlite3Config.mutex.xMutexAlloc(id);
}

sqlite3_mutex *sqlite3MutexAlloc(int id){
  if( !sqlite3Config.bCoreMutex ){
    return 0;
  }







>
>
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
  return rc;
}

/*
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
*/
sqlite3_mutex *sqlite3_mutex_alloc(int id){
#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return 0;
#endif
  return sqlite3Config.mutex.xMutexAlloc(id);
}

sqlite3_mutex *sqlite3MutexAlloc(int id){
  if( !sqlite3Config.bCoreMutex ){
    return 0;
  }