1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Add the xShmRelease() method to the VFS. The os_unix.c implementation of

the shared memory logic is still non-functional.

FossilOrigin-Name: ed715b47c5f7657fbf901805981867898054b14d
This commit is contained in:
drh
2010-04-27 11:49:27 +00:00
parent e106de6317
commit af75c8695b
11 changed files with 46 additions and 84 deletions

View File

@@ -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() */
@@ -4679,6 +4684,14 @@ static int unixShmSize(
return rc;
}
/*
** 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.
*/
@@ -5934,6 +5947,7 @@ int sqlite3_os_init(void){
unixGetLastError, /* xGetLastError */ \
unixShmOpen, /* xShmOpen */ \
unixShmSize, /* xShmSize */ \
unixShmRelease, /* xShmRelease */ \
0, /* xShmPush */ \
0, /* xShmPull */ \
unixShmLock, /* xShmLock */ \