aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-04-26 18:58:54 +0000
committerdrh <drh@noemail.net>2016-04-26 18:58:54 +0000
commit97a7e5e68cdfe31e9e020ed59d8f93787e18cd25 (patch)
treef8822afd0388a9bac1f61fa582b2350a2ad3c845 /src/os_unix.c
parentb283a0cde90b25fd01054228e4c5a680233d4742 (diff)
downloadsqlite-97a7e5e68cdfe31e9e020ed59d8f93787e18cd25.tar.gz
sqlite-97a7e5e68cdfe31e9e020ed59d8f93787e18cd25.zip
The pcache and the built-in VFSes should not use mutexes when
SQLITE_CONFIG_SINGLETHREAD is set. FossilOrigin-Name: 12418b100196abbfbfb85e0ab4bb6b1cbf335df7
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index aadb414af..01de00e0d 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4288,10 +4288,12 @@ static int unixOpenSharedMemory(unixFile *pDbFd){
pShmNode->h = -1;
pDbFd->pInode->pShmNode = pShmNode;
pShmNode->pInode = pDbFd->pInode;
- pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
- if( pShmNode->mutex==0 ){
- rc = SQLITE_NOMEM_BKPT;
- goto shm_open_err;
+ if( sqlite3GlobalConfig.bCoreMutex ){
+ pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
+ if( pShmNode->mutex==0 ){
+ rc = SQLITE_NOMEM_BKPT;
+ goto shm_open_err;
+ }
}
if( pInode->bProcessLock==0 ){