Index: src/mutex.c ================================================================== --- src/mutex.c +++ src/mutex.c @@ -22,10 +22,22 @@ ** allocate a mutex while the system is uninitialized. */ static SQLITE_WSD int mutexIsInit = 0; #endif /* SQLITE_DEBUG */ +/* +** Implementations can specify an alternative routine for initializing +** the mutex using the SQLITE_MUTEX_DEFAULT macro. This macro should +** resolve to an expression that returns a pointer to an +** sqlite3_mutex_methods object that implements the default mutex. +** This is an undocumented feature and may not be supported in future +** releases. +*/ +#if !defined(SQLITE_MUTEX_DEFAULT) +# define SQLITE_MUTEX_DEFAULT sqlite3DefaultMutex() +#endif + #ifndef SQLITE_MUTEX_OMIT /* ** Initialize the mutex system. */ @@ -39,11 +51,11 @@ */ sqlite3_mutex_methods const *pFrom; sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex; if( sqlite3GlobalConfig.bCoreMutex ){ - pFrom = sqlite3DefaultMutex(); + pFrom = SQLITE_MUTEX_DEFAULT; }else{ pFrom = sqlite3NoopMutex(); } memcpy(pTo, pFrom, offsetof(sqlite3_mutex_methods, xMutexAlloc)); memcpy(&pTo->xMutexFree, &pFrom->xMutexFree,