SQLite

Check-in [7d4562e9d5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use __sync_synchronous(), when available, instead of a mutex when a memory barrier is needed.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | debug
Files: files | file ages | folders
SHA1: 7d4562e9d577e21406e05300b9a1ad56fded2309
User & Date: drh 2016-07-29 14:23:23.484
Context
2016-07-29
14:31
Enhance a debugging log message to better identify a mutex. (check-in: e60cb6d885 user: dan tags: debug)
14:23
Use __sync_synchronous(), when available, instead of a mutex when a memory barrier is needed. (check-in: 7d4562e9d5 user: drh tags: debug)
14:10
Add calls to sqlite3_log() when sqlite3_mutex_enter() takes more than 100,000 CPU cycles. (check-in: 33c7ef7aca user: drh tags: debug)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
4625
4626
4627
4628
4629
4630
4631



4632
4633

4634
4635
4636
4637
4638
4639
4640
** All loads and stores begun before the barrier must complete before
** any load or store begun after the barrier.
*/
static void unixShmBarrier(
  sqlite3_file *fd                /* Database file holding the shared memory */
){
  UNUSED_PARAMETER(fd);



  unixEnterMutex();
  unixLeaveMutex();

}

/*
** Close a connection to shared-memory.  Delete the underlying 
** storage if deleteFlag is true.
**
** If there is no shared memory associated with the connection then this







>
>
>


>







4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
** All loads and stores begun before the barrier must complete before
** any load or store begun after the barrier.
*/
static void unixShmBarrier(
  sqlite3_file *fd                /* Database file holding the shared memory */
){
  UNUSED_PARAMETER(fd);
#if defined(__GNUC__) && GCC_VERSION>=4001000
  __sync_synchronize();
#else
  unixEnterMutex();
  unixLeaveMutex();
#endif
}

/*
** Close a connection to shared-memory.  Delete the underlying 
** storage if deleteFlag is true.
**
** If there is no shared memory associated with the connection then this