aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/os_os2.c11
-rw-r--r--src/os_unix.c18
-rw-r--r--src/os_win.c11
-rw-r--r--src/sqlite.h.in3
-rw-r--r--src/test6.c9
-rw-r--r--src/test_demovfs.c9
-rw-r--r--src/test_devsym.c9
-rw-r--r--src/test_journal.c9
-rw-r--r--src/test_osinst.c9
-rw-r--r--src/wal.c3
10 files changed, 22 insertions, 69 deletions
diff --git a/src/os_os2.c b/src/os_os2.c
index 04b6dce0e..1c55e4be6 100644
--- a/src/os_os2.c
+++ b/src/os_os2.c
@@ -1111,16 +1111,7 @@ int sqlite3_os_init(void){
os2Randomness, /* xRandomness */
os2Sleep, /* xSleep */
os2CurrentTime, /* xCurrentTime */
- os2GetLastError /* xGetLastError */
- 0, /* xShmOpen */
- 0, /* xShmSize */
- 0, /* xShmPush */
- 0, /* xShmPull */
- 0, /* xShmLock */
- 0, /* xShmClose */
- 0, /* xShmDelete */
- 0, /* xRename */
- 0, /* xCurrentTimeInt64 */
+ os2GetLastError, /* xGetLastError */
};
sqlite3_vfs_register(&os2Vfs, 1);
initUconvObjects();
diff --git a/src/os_unix.c b/src/os_unix.c
index b2cf9be76..d603caa0d 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4647,8 +4647,13 @@ shm_open_err:
** Query and/or changes the size of a shared-memory segment.
** The reqSize parameter is the new size of the segment, or -1 to
** do just a query. The size of the segment after resizing is
-** written into pNewSize. The start of the shared memory buffer
-** is stored in **ppBuffer.
+** written into pNewSize. A writer lock is held on the shared memory
+** segment while resizing it.
+**
+** If ppBuffer is not NULL, the a reader lock is acquired no the shared
+** memory segment and *ppBuffer is made to point to the start of the
+** shared memory segment. xShmRelease() must be called to release the
+** lock.
*/
static int unixShmSize(
sqlite3_shm *pSharedMem, /* Pointer returned by unixShmOpen() */
@@ -4680,6 +4685,14 @@ static int unixShmSize(
}
/*
+** Release the lock held on the shared memory segment to that other
+** threads are free to resize it if necessary.
+*/
+static int unixShmRelease(sqlite3_shm *pSharedMem){
+ return SQLITE_OK;
+}
+
+/*
** Create or release a lock on shared memory.
*/
static int unixShmLock(
@@ -5934,6 +5947,7 @@ int sqlite3_os_init(void){
unixGetLastError, /* xGetLastError */ \
unixShmOpen, /* xShmOpen */ \
unixShmSize, /* xShmSize */ \
+ unixShmRelease, /* xShmRelease */ \
0, /* xShmPush */ \
0, /* xShmPull */ \
unixShmLock, /* xShmLock */ \
diff --git a/src/os_win.c b/src/os_win.c
index 31c3cffce..cfcf49e36 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -1912,16 +1912,7 @@ int sqlite3_os_init(void){
winRandomness, /* xRandomness */
winSleep, /* xSleep */
winCurrentTime, /* xCurrentTime */
- winGetLastError /* xGetLastError */
- 0, /* xShmOpen */
- 0, /* xShmSize */
- 0, /* xShmPush */
- 0, /* xShmPull */
- 0, /* xShmLock */
- 0, /* xShmClose */
- 0, /* xShmDelete */
- 0, /* xRename */
- 0, /* xCurrentTimeInt64 */
+ winGetLastError, /* xGetLastError */
};
sqlite3_vfs_register(&winVfs, 1);
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index f673781e0..7bc750944 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -844,7 +844,8 @@ struct sqlite3_vfs {
** definition. Those that follow are added in version 2 or later
*/
int (*xShmOpen)(sqlite3_vfs*, const char *zName, sqlite3_shm**);
- int (*xShmSize)(sqlite3_shm*, int reqSize, int *pNewSize, char **);
+ int (*xShmSize)(sqlite3_shm*, int reqSize, int *pNewSize, char**);
+ int (*xShmRelease)(sqlite3_shm*);
int (*xShmPush)(sqlite3_shm*);
int (*xShmPull)(sqlite3_shm*);
int (*xShmLock)(sqlite3_shm*, int lockType, int ofst, int nByte);
diff --git a/src/test6.c b/src/test6.c
index a6e995451..3da9502fd 100644
--- a/src/test6.c
+++ b/src/test6.c
@@ -782,15 +782,6 @@ static int crashEnableCmd(
cfRandomness, /* xRandomness */
cfSleep, /* xSleep */
cfCurrentTime, /* xCurrentTime */
- 0, /* xShmOpen */
- 0, /* xShmSize */
- 0, /* xShmPush */
- 0, /* xShmPull */
- 0, /* xShmLock */
- 0, /* xShmClose */
- 0, /* xShmDelete */
- 0, /* xRename */
- 0 /* xCurrentTimeInt64 */
};
if( objc!=2 ){
diff --git a/src/test_demovfs.c b/src/test_demovfs.c
index d91a389db..7cdae8067 100644
--- a/src/test_demovfs.c
+++ b/src/test_demovfs.c
@@ -624,15 +624,6 @@ sqlite3_vfs *sqlite3_demovfs(void){
demoRandomness, /* xRandomness */
demoSleep, /* xSleep */
demoCurrentTime, /* xCurrentTime */
- 0, /* xShmOpen */
- 0, /* xShmSize */
- 0, /* xShmPush */
- 0, /* xShmPull */
- 0, /* xShmLock */
- 0, /* xShmClose */
- 0, /* xShmDelete */
- 0, /* xRename */
- 0 /* xCurrentTimeInt64 */
};
return &demovfs;
}
diff --git a/src/test_devsym.c b/src/test_devsym.c
index 4249573aa..9f7153804 100644
--- a/src/test_devsym.c
+++ b/src/test_devsym.c
@@ -93,15 +93,6 @@ static sqlite3_vfs devsym_vfs = {
devsymRandomness, /* xRandomness */
devsymSleep, /* xSleep */
devsymCurrentTime, /* xCurrentTime */
- 0, /* xShmOpen */
- 0, /* xShmSize */
- 0, /* xShmPush */
- 0, /* xShmPull */
- 0, /* xShmLock */
- 0, /* xShmClose */
- 0, /* xShmDelete */
- 0, /* xRename */
- 0 /* xCurrentTimeInt64 */
};
static sqlite3_io_methods devsym_io_methods = {
diff --git a/src/test_journal.c b/src/test_journal.c
index fcfe778d1..020b41575 100644
--- a/src/test_journal.c
+++ b/src/test_journal.c
@@ -180,15 +180,6 @@ static sqlite3_vfs jt_vfs = {
jtRandomness, /* xRandomness */
jtSleep, /* xSleep */
jtCurrentTime, /* xCurrentTime */
- 0, /* xShmOpen */
- 0, /* xShmSize */
- 0, /* xShmPush */
- 0, /* xShmPull */
- 0, /* xShmLock */
- 0, /* xShmClose */
- 0, /* xShmDelete */
- 0, /* xRename */
- 0 /* xCurrentTimeInt64 */
};
static sqlite3_io_methods jt_io_methods = {
diff --git a/src/test_osinst.c b/src/test_osinst.c
index c6d16aa67..365da38d8 100644
--- a/src/test_osinst.c
+++ b/src/test_osinst.c
@@ -204,15 +204,6 @@ static sqlite3_vfs inst_vfs = {
instRandomness, /* xRandomness */
instSleep, /* xSleep */
instCurrentTime, /* xCurrentTime */
- 0, /* xShmOpen */
- 0, /* xShmSize */
- 0, /* xShmPush */
- 0, /* xShmPull */
- 0, /* xShmLock */
- 0, /* xShmClose */
- 0, /* xShmDelete */
- 0, /* xRename */
- 0 /* xCurrentTimeInt64 */
};
static sqlite3_io_methods inst_io_methods = {
diff --git a/src/wal.c b/src/wal.c
index 14ee78d9f..4710c89a5 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -4,6 +4,7 @@
** "journal_mode=wal" mode.
*/
+
/*
** LOG FILE FORMAT
**
@@ -157,7 +158,7 @@ struct LogSummary {
** obtains the DMH lock (see below), and while log recovery is
** being run.
**
-** DMH: The DMH (Dead Mans Hand mechanism) lock is used to ensure
+** DMS: The DMS (Dead Mans Switch mechanism) lock is used to ensure
** that log-recovery is always run following a system restart.
** When it first opens a log-summary file, a process takes a
** SHARED lock on the DMH region. This lock is not released until