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

Updates to requirements tags on the mutex documentation.

FossilOrigin-Name: fcf8b7e4c6c3893e2004a28dc9f0f677907b4ba9
This commit is contained in:
drh
2014-11-20 23:03:42 +00:00
parent 5e3b49bc42
commit 341eca7f68
3 changed files with 45 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
C Add\srequirements\smarks\son\sthe\sbuilt-in\scollating\sfunctions. C Updates\sto\srequirements\stags\son\sthe\smutex\sdocumentation.
D 2014-11-20T19:22:26.830 D 2014-11-20T23:03:42.154
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in a226317fdf3f4c895fb3cfedc355b4d0868ce1fb F Makefile.in a226317fdf3f4c895fb3cfedc355b4d0868ce1fb
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -230,7 +230,7 @@ F src/resolve.c 4965007d6497b6a4d7a6d98751cc39712885f952
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
F src/select.c 428165951748151e87a15295b7357221433e311b F src/select.c 428165951748151e87a15295b7357221433e311b
F src/shell.c bc28d5992109717c87804e2eb1a08a7c8cc7a2fd F src/shell.c bc28d5992109717c87804e2eb1a08a7c8cc7a2fd
F src/sqlite.h.in dfbdcd6e52e7652648d8e7634a7c191fcac8e6ce F src/sqlite.h.in c63db0117aeb749ca02b6016dbbbccbbbd9a141d
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
F src/sqliteInt.h c9e95b8fa9aee30d46387735c5be73fa58886e38 F src/sqliteInt.h c9e95b8fa9aee30d46387735c5be73fa58886e38
@@ -1221,7 +1221,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P ef9fbc08b0a047042deeb2d6007d67028fefb9e2 P 4b608b62ac8d4eafdb76192b3b5db272332a4bfd
R 87fc16da633f081b9c3d6138857b30da R b10e3d696841d651117121c42237df0a
U drh U drh
Z 4f4a01f4cbeff0ca684ca414f4595d57 Z 5d29b887364b9011d92605ad266bc7f8

View File

@@ -1 +1 @@
4b608b62ac8d4eafdb76192b3b5db272332a4bfd fcf8b7e4c6c3893e2004a28dc9f0f677907b4ba9

View File

@@ -5900,34 +5900,34 @@ int sqlite3_vfs_unregister(sqlite3_vfs*);
** **
** The SQLite source code contains multiple implementations ** The SQLite source code contains multiple implementations
** of these mutex routines. An appropriate implementation ** of these mutex routines. An appropriate implementation
** is selected automatically at compile-time. ^(The following ** is selected automatically at compile-time. The following
** implementations are available in the SQLite core: ** implementations are available in the SQLite core:
** **
** <ul> ** <ul>
** <li> SQLITE_MUTEX_PTHREADS ** <li> SQLITE_MUTEX_PTHREADS
** <li> SQLITE_MUTEX_W32 ** <li> SQLITE_MUTEX_W32
** <li> SQLITE_MUTEX_NOOP ** <li> SQLITE_MUTEX_NOOP
** </ul>)^ ** </ul>
** **
** ^The SQLITE_MUTEX_NOOP implementation is a set of routines ** The SQLITE_MUTEX_NOOP implementation is a set of routines
** that does no real locking and is appropriate for use in ** that does no real locking and is appropriate for use in
** a single-threaded application. ^The SQLITE_MUTEX_PTHREADS and ** a single-threaded application. The SQLITE_MUTEX_PTHREADS and
** SQLITE_MUTEX_W32 implementations are appropriate for use on Unix ** SQLITE_MUTEX_W32 implementations are appropriate for use on Unix
** and Windows. ** and Windows.
** **
** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor ** If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor
** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex ** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex
** implementation is included with the library. In this case the ** implementation is included with the library. In this case the
** application must supply a custom mutex implementation using the ** application must supply a custom mutex implementation using the
** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function ** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function
** before calling sqlite3_initialize() or any other public sqlite3_ ** before calling sqlite3_initialize() or any other public sqlite3_
** function that calls sqlite3_initialize().)^ ** function that calls sqlite3_initialize().
** **
** ^The sqlite3_mutex_alloc() routine allocates a new ** ^The sqlite3_mutex_alloc() routine allocates a new
** mutex and returns a pointer to it. ^If it returns NULL ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc()
** that means that a mutex could not be allocated. ^SQLite ** routine returns NULL if it is unable to allocate the requested
** will unwind its stack and return an error. ^(The argument ** mutex. The argument to sqlite3_mutex_alloc() must one of these
** to sqlite3_mutex_alloc() is one of these integer constants: ** integer constants:
** **
** <ul> ** <ul>
** <li> SQLITE_MUTEX_FAST ** <li> SQLITE_MUTEX_FAST
@@ -5940,7 +5940,8 @@ int sqlite3_vfs_unregister(sqlite3_vfs*);
** <li> SQLITE_MUTEX_STATIC_PMEM ** <li> SQLITE_MUTEX_STATIC_PMEM
** <li> SQLITE_MUTEX_STATIC_APP1 ** <li> SQLITE_MUTEX_STATIC_APP1
** <li> SQLITE_MUTEX_STATIC_APP2 ** <li> SQLITE_MUTEX_STATIC_APP2
** </ul>)^ ** <li> SQLITE_MUTEX_STATIC_APP3
** </ul>
** **
** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) ** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE)
** cause sqlite3_mutex_alloc() to create ** cause sqlite3_mutex_alloc() to create
@@ -5948,14 +5949,14 @@ int sqlite3_vfs_unregister(sqlite3_vfs*);
** is used but not necessarily so when SQLITE_MUTEX_FAST is used. ** is used but not necessarily so when SQLITE_MUTEX_FAST is used.
** The mutex implementation does not need to make a distinction ** The mutex implementation does not need to make a distinction
** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does
** not want to. ^SQLite will only request a recursive mutex in ** not want to. SQLite will only request a recursive mutex in
** cases where it really needs one. ^If a faster non-recursive mutex ** cases where it really needs one. If a faster non-recursive mutex
** implementation is available on the host platform, the mutex subsystem ** implementation is available on the host platform, the mutex subsystem
** might return such a mutex in response to SQLITE_MUTEX_FAST. ** might return such a mutex in response to SQLITE_MUTEX_FAST.
** **
** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other ** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other
** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return ** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return
** a pointer to a static preexisting mutex. ^Six static mutexes are ** a pointer to a static preexisting mutex. ^Nine static mutexes are
** used by the current version of SQLite. Future versions of SQLite ** used by the current version of SQLite. Future versions of SQLite
** may add additional static mutexes. Static mutexes are for internal ** may add additional static mutexes. Static mutexes are for internal
** use by SQLite only. Applications that use SQLite mutexes should ** use by SQLite only. Applications that use SQLite mutexes should
@@ -5964,16 +5965,13 @@ int sqlite3_vfs_unregister(sqlite3_vfs*);
** **
** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST ** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()
** returns a different mutex on every call. ^But for the static ** returns a different mutex on every call. ^For the static
** mutex types, the same mutex is returned on every call that has ** mutex types, the same mutex is returned on every call that has
** the same type number. ** the same type number.
** **
** ^The sqlite3_mutex_free() routine deallocates a previously ** ^The sqlite3_mutex_free() routine deallocates a previously
** allocated dynamic mutex. ^SQLite is careful to deallocate every ** allocated dynamic mutex. Attempting to deallocate a static
** dynamic mutex that it allocates. The dynamic mutexes must not be in ** mutex results in undefined behavior.
** use when they are deallocated. Attempting to deallocate a static
** mutex results in undefined behavior. ^SQLite never deallocates
** a static mutex.
** **
** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt ** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
** to enter a mutex. ^If another thread is already within the mutex, ** to enter a mutex. ^If another thread is already within the mutex,
@@ -5981,23 +5979,21 @@ int sqlite3_vfs_unregister(sqlite3_vfs*);
** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] ** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK]
** upon successful entry. ^(Mutexes created using ** upon successful entry. ^(Mutexes created using
** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. ** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread.
** In such cases the, ** In such cases, the
** mutex must be exited an equal number of times before another thread ** mutex must be exited an equal number of times before another thread
** can enter.)^ ^(If the same thread tries to enter any other ** can enter.)^ If the same thread tries to enter any mutex other
** kind of mutex more than once, the behavior is undefined. ** than an SQLITE_MUTEX_RECURSIVE more than once, the behavior is undefined.
** SQLite will never exhibit
** such behavior in its own use of mutexes.)^
** **
** ^(Some systems (for example, Windows 95) do not support the operation ** ^(Some systems (for example, Windows 95) do not support the operation
** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try()
** will always return SQLITE_BUSY. The SQLite core only ever uses ** will always return SQLITE_BUSY. The SQLite core only ever uses
** sqlite3_mutex_try() as an optimization so this is acceptable behavior.)^ ** sqlite3_mutex_try() as an optimization so this is acceptable
** behavior.)^
** **
** ^The sqlite3_mutex_leave() routine exits a mutex that was ** ^The sqlite3_mutex_leave() routine exits a mutex that was
** previously entered by the same thread. ^(The behavior ** previously entered by the same thread. The behavior
** is undefined if the mutex is not currently entered by the ** is undefined if the mutex is not currently entered by the
** calling thread or is not currently allocated. SQLite will ** calling thread or is not currently allocated.
** never do either.)^
** **
** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or
** sqlite3_mutex_leave() is a NULL pointer, then all three routines ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
@@ -6018,9 +6014,9 @@ void sqlite3_mutex_leave(sqlite3_mutex*);
** used to allocate and use mutexes. ** used to allocate and use mutexes.
** **
** Usually, the default mutex implementations provided by SQLite are ** Usually, the default mutex implementations provided by SQLite are
** sufficient, however the user has the option of substituting a custom ** sufficient, however the application has the option of substituting a custom
** implementation for specialized deployments or systems for which SQLite ** implementation for specialized deployments or systems for which SQLite
** does not provide a suitable implementation. In this case, the user ** does not provide a suitable implementation. In this case, the application
** creates and populates an instance of this structure to pass ** creates and populates an instance of this structure to pass
** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option. ** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.
** Additionally, an instance of this structure can be used as an ** Additionally, an instance of this structure can be used as an
@@ -6061,13 +6057,13 @@ void sqlite3_mutex_leave(sqlite3_mutex*);
** (i.e. it is acceptable to provide an implementation that segfaults if ** (i.e. it is acceptable to provide an implementation that segfaults if
** it is passed a NULL pointer). ** it is passed a NULL pointer).
** **
** The xMutexInit() method must be threadsafe. ^It must be harmless to ** The xMutexInit() method must be threadsafe. It must be harmless to
** invoke xMutexInit() multiple times within the same process and without ** invoke xMutexInit() multiple times within the same process and without
** intervening calls to xMutexEnd(). Second and subsequent calls to ** intervening calls to xMutexEnd(). Second and subsequent calls to
** xMutexInit() must be no-ops. ** xMutexInit() must be no-ops.
** **
** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] ** xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
** and its associates). ^Similarly, xMutexAlloc() must not use SQLite memory ** and its associates). Similarly, xMutexAlloc() must not use SQLite memory
** allocation for a static mutex. ^However xMutexAlloc() may use SQLite ** allocation for a static mutex. ^However xMutexAlloc() may use SQLite
** memory allocation for a fast or recursive mutex. ** memory allocation for a fast or recursive mutex.
** **
@@ -6093,29 +6089,29 @@ struct sqlite3_mutex_methods {
** CAPI3REF: Mutex Verification Routines ** CAPI3REF: Mutex Verification Routines
** **
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines
** are intended for use inside assert() statements. ^The SQLite core ** are intended for use inside assert() statements. The SQLite core
** never uses these routines except inside an assert() and applications ** never uses these routines except inside an assert() and applications
** are advised to follow the lead of the core. ^The SQLite core only ** are advised to follow the lead of the core. The SQLite core only
** provides implementations for these routines when it is compiled ** provides implementations for these routines when it is compiled
** with the SQLITE_DEBUG flag. ^External mutex implementations ** with the SQLITE_DEBUG flag. External mutex implementations
** are only required to provide these routines if SQLITE_DEBUG is ** are only required to provide these routines if SQLITE_DEBUG is
** defined and if NDEBUG is not defined. ** defined and if NDEBUG is not defined.
** **
** ^These routines should return true if the mutex in their argument ** These routines should return true if the mutex in their argument
** is held or not held, respectively, by the calling thread. ** is held or not held, respectively, by the calling thread.
** **
** ^The implementation is not required to provide versions of these ** The implementation is not required to provide versions of these
** routines that actually work. If the implementation does not provide working ** routines that actually work. If the implementation does not provide working
** versions of these routines, it should at least provide stubs that always ** versions of these routines, it should at least provide stubs that always
** return true so that one does not get spurious assertion failures. ** return true so that one does not get spurious assertion failures.
** **
** ^If the argument to sqlite3_mutex_held() is a NULL pointer then ** If the argument to sqlite3_mutex_held() is a NULL pointer then
** the routine should return 1. This seems counter-intuitive since ** the routine should return 1. This seems counter-intuitive since
** clearly the mutex cannot be held if it does not exist. But ** clearly the mutex cannot be held if it does not exist. But
** the reason the mutex does not exist is because the build is not ** the reason the mutex does not exist is because the build is not
** using mutexes. And we do not want the assert() containing the ** using mutexes. And we do not want the assert() containing the
** call to sqlite3_mutex_held() to fail, so a non-zero return is ** call to sqlite3_mutex_held() to fail, so a non-zero return is
** the appropriate thing to do. ^The sqlite3_mutex_notheld() ** the appropriate thing to do. The sqlite3_mutex_notheld()
** interface should also return 1 when given a NULL pointer. ** interface should also return 1 when given a NULL pointer.
*/ */
#ifndef NDEBUG #ifndef NDEBUG