aboutsummaryrefslogtreecommitdiff
path: root/src/mutex_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-09-15 17:31:47 +0000
committerdrh <drh@noemail.net>2015-09-15 17:31:47 +0000
commit81966bea224b5964ec553e413643578b916a728f (patch)
tree81db4384b1efabc86947416a887937e3b0a16299 /src/mutex_unix.c
parent163c29c5f309fa1d6f2b2816731828d503f0af7a (diff)
parent6609bab24d84219140f28d9bda1ebee4389be5ca (diff)
downloadsqlite-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.c11
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; }