aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c18
1 files changed, 16 insertions, 2 deletions
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 */ \