1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Add the SQLITE_CONFIG_MUTEX symbol for use with sqlite3_config(). (CVS 5228)

FossilOrigin-Name: af1835bb5f5e3fb78d782c7c287e20db169e883f
This commit is contained in:
danielk1977
2008-06-17 18:57:49 +00:00
parent 6d2ab0e431
commit b2e36222af
5 changed files with 30 additions and 15 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.445 2008/06/16 20:51:16 drh Exp $
** $Id: main.c,v 1.446 2008/06/17 18:57:49 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -76,9 +76,7 @@ int sqlite3_initialize(void){
if( sqlite3IsInit ) return SQLITE_OK;
rc = sqlite3_mutex_init();
if( rc==SQLITE_OK ){
#ifndef SQLITE_MUTEX_NOOP
sqlite3_mutex *pMutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
sqlite3_mutex_enter(pMutex);
if( sqlite3IsInit==0 ){
sqlite3IsInit = 1;
@@ -153,6 +151,11 @@ int sqlite3_config(int op, ...){
sqlite3Config.m = *va_arg(ap, sqlite3_mem_methods*);
break;
}
case SQLITE_CONFIG_MUTEX: {
/* Specify an alternative mutex implementation */
sqlite3Config.mutex = *va_arg(ap, sqlite3_mutex_methods*);
break;
}
case SQLITE_CONFIG_MEMSTATUS: {
/* Enable or disable the malloc status collection */
sqlite3Config.bMemstat = va_arg(ap, int);