1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Use the GCC built-in __sync_fetch_and_sub() to make the sqlite3StatusDown()

routine atomic, and thereby avoid some mutexing.

FossilOrigin-Name: f69ce75b3d94331fdbfa2f3a27d61db24c285d2b
This commit is contained in:
drh
2017-01-03 18:05:04 +00:00
parent 4a47761e0d
commit eea46aeafc
5 changed files with 32 additions and 13 deletions

View File

@@ -228,6 +228,15 @@
# define SQLITE_NOINLINE
#endif
/*
** The SQLITE_ATOMIC_STATUS_DOWN macro is defined if and only if
** the sqlite3StatusDown() function is threadsafe.
*/
#if !defined(SQLITE_DISABLE_INTRINSIC) \
&& defined(__GNUC__) && GCC_VERSION>=4004000
# define SQLITE_ATOMIC_STATUS_DOWN 1
#endif
/*
** Make sure that the compiler intrinsics we desire are enabled when
** compiling with an appropriate version of MSVC unless prevented by