diff options
Diffstat (limited to 'src/mutex_unix.c')
-rw-r--r-- | src/mutex_unix.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mutex_unix.c b/src/mutex_unix.c index 0a493fa6a..cebb96c90 100644 --- a/src/mutex_unix.c +++ b/src/mutex_unix.c @@ -81,6 +81,17 @@ static int pthreadMutexNotheld(sqlite3_mutex *p){ #endif /* +** Try to provide a memory barrier operation, needed for initialization only. +*/ +void sqlite3MemoryBarrier(void){ +#if defined(SQLITE_MEMORY_BARRIER) + SQLITE_MEMORY_BARRIER; +#elif defined(__GNUC__) && GCC_VERSION>=4001000 + __sync_synchronize(); +#endif +} + +/* ** Initialize and deinitialize the mutex subsystem. */ static int pthreadMutexInit(void){ return SQLITE_OK; } |