aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-10-07 15:25:48 +0000
committerdrh <drh@noemail.net>2008-10-07 15:25:48 +0000
commit18472fa7b80fffe589ac558e25d84b3969a70e70 (patch)
tree1dda54476935c3056b2946b3a7e77e32c4c4a2cf /src/main.c
parent3d9cf5177f663bfa87736745f4eb8b93bc883d8a (diff)
downloadsqlite-18472fa7b80fffe589ac558e25d84b3969a70e70.tar.gz
sqlite-18472fa7b80fffe589ac558e25d84b3969a70e70.zip
Remove the SQLITE_MUTEX_APPDEF compile-time option. The SQLITE_THREADSAFE=0
option always removes all mutex code. For application-defined mutexes only, use SQLITE_THREADSAFE=1 with SQLITE_MUTEX_NOOP=1. Ticket #3421. (CVS 5779) FossilOrigin-Name: 02a12eb1cfe9307c66556105a1a99d657cc01ab5
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c
index eece6f11c..12b98c044 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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.502 2008/09/23 17:39:26 danielk1977 Exp $
+** $Id: main.c,v 1.503 2008/10/07 15:25:48 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -245,6 +245,11 @@ int sqlite3_config(int op, ...){
va_start(ap, op);
switch( op ){
+
+ /* Mutex configuration options are only available in a threadsafe
+ ** compile.
+ */
+#if SQLITE_THREADSAFE
case SQLITE_CONFIG_SINGLETHREAD: {
/* Disable all mutexing */
sqlite3GlobalConfig.bCoreMutex = 0;
@@ -264,6 +269,19 @@ int sqlite3_config(int op, ...){
sqlite3GlobalConfig.bFullMutex = 1;
break;
}
+ case SQLITE_CONFIG_MUTEX: {
+ /* Specify an alternative mutex implementation */
+ sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
+ break;
+ }
+ case SQLITE_CONFIG_GETMUTEX: {
+ /* Retrieve the current mutex implementation */
+ *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
+ break;
+ }
+#endif
+
+
case SQLITE_CONFIG_MALLOC: {
/* Specify an alternative malloc implementation */
sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*);
@@ -275,16 +293,6 @@ int sqlite3_config(int op, ...){
*va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m;
break;
}
- case SQLITE_CONFIG_MUTEX: {
- /* Specify an alternative mutex implementation */
- sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
- break;
- }
- case SQLITE_CONFIG_GETMUTEX: {
- /* Retrieve the current mutex implementation */
- *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
- break;
- }
case SQLITE_CONFIG_MEMSTATUS: {
/* Enable or disable the malloc status collection */
sqlite3GlobalConfig.bMemstat = va_arg(ap, int);