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