diff options
author | drh <drh@noemail.net> | 2015-09-15 17:31:47 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-09-15 17:31:47 +0000 |
commit | 81966bea224b5964ec553e413643578b916a728f (patch) | |
tree | 81db4384b1efabc86947416a887937e3b0a16299 /src/mutex_unix.c | |
parent | 163c29c5f309fa1d6f2b2816731828d503f0af7a (diff) | |
parent | 6609bab24d84219140f28d9bda1ebee4389be5ca (diff) | |
download | sqlite-81966bea224b5964ec553e413643578b916a728f.tar.gz sqlite-81966bea224b5964ec553e413643578b916a728f.zip |
Merge enhancements from trunk.
FossilOrigin-Name: 66fe06832614010d3156d7b21a760af9957018cc
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; } |