aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mutex_unix.c7
-rw-r--r--src/mutex_w32.c6
2 files changed, 9 insertions, 4 deletions
diff --git a/src/mutex_unix.c b/src/mutex_unix.c
index e181ba5bd..78fba1d81 100644
--- a/src/mutex_unix.c
+++ b/src/mutex_unix.c
@@ -84,11 +84,10 @@ static int pthreadMutexNotheld(sqlite3_mutex *p){
** Try to provide a memory barrier operation, needed for initialization only.
*/
void sqlite3MemoryBarrier(void){
-#if defined(__GNUC__)
- __sync_synchronize();
-#endif
-#ifdef SQLITE_MEMORY_BARRIER
+#if defined(SQLITE_MEMORY_BARRIER)
SQLITE_MEMORY_BARRIER;
+#elif defined(__GNUC__)
+ __sync_synchronize();
#endif
}
diff --git a/src/mutex_w32.c b/src/mutex_w32.c
index 9f2fb048f..90be07db2 100644
--- a/src/mutex_w32.c
+++ b/src/mutex_w32.c
@@ -81,7 +81,13 @@ static int winMutexNotheld(sqlite3_mutex *p){
** 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__)
+ __sync_synchronize();
+#else
MemoryBarrier();
+#endif
}
/*