Index: src/os_unix.c ================================================================== --- src/os_unix.c +++ src/os_unix.c @@ -4994,16 +4994,20 @@ */ static void unixShmBarrier( sqlite3_file *fd /* Database file holding the shared memory */ ){ UNUSED_PARAMETER(fd); +#ifdef SQLITE_MUTEXFREE_SHMLOCK + __sync_synchronize(); +#else sqlite3MemoryBarrier(); /* compiler-defined memory barrier */ assert( fd->pMethods->xLock==nolockLock || unixFileMutexNotheld((unixFile*)fd) ); unixEnterMutex(); /* Also mutex, for redundancy */ unixLeaveMutex(); +#endif } /* ** Close a connection to shared-memory. Delete the underlying ** storage if deleteFlag is true.