mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Add a memory barrier to the mutex initialization logic, try to work around
an issue reported by WebKit. FossilOrigin-Name: 11a9a786ec06403addb47f5c6fb142b382fae522
This commit is contained in:
@@ -80,6 +80,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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user