/ Check-in [47dc24bd]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Improved memory barrier that should work with MinGW on older versions of Windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 47dc24bd1e8f76eb17ba53a883b8984b3e1b2934
User & Date: drh 2015-09-06 10:31:37
Context
2015-09-07
02:23
Improved "Parser Statistics" output (the -s option) for the Lemon parser generator. check-in: 809503e4 user: drh tags: trunk
2015-09-06
10:31
Improved memory barrier that should work with MinGW on older versions of Windows. check-in: 47dc24bd user: drh tags: trunk
02:51
Add a memory barrier to the mutex initialization logic, try to work around an issue reported by WebKit. check-in: 11a9a786 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/mutex_unix.c.

80
81
82
83
84
85
86


87
88
89
90
91
92
93
94
95
96
97
98
}
#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.
*/
static int pthreadMutexInit(void){ return SQLITE_OK; }







>
>
|

<
<
<







80
81
82
83
84
85
86
87
88
89
90



91
92
93
94
95
96
97
}
#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__)
  __sync_synchronize();



#endif
}

/*
** Initialize and deinitialize the mutex subsystem.
*/
static int pthreadMutexInit(void){ return SQLITE_OK; }

Changes to src/mutex_w32.c.

77
78
79
80
81
82
83





84

85
86
87
88
89
90
91
}
#endif

/*
** Try to provide a memory barrier operation, needed for initialization only.
*/
void sqlite3MemoryBarrier(void){





  MemoryBarrier();

}

/*
** Initialize and deinitialize the mutex subsystem.
*/
static sqlite3_mutex winMutex_staticMutexes[] = {
  SQLITE3_MUTEX_INITIALIZER,







>
>
>
>
>

>







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
}
#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__)
  __sync_synchronize();
#else
  MemoryBarrier();
#endif
}

/*
** Initialize and deinitialize the mutex subsystem.
*/
static sqlite3_mutex winMutex_staticMutexes[] = {
  SQLITE3_MUTEX_INITIALIZER,