diff options
Diffstat (limited to 'static/netbsd/man3/sqlite3_threadsafe.3')
| -rw-r--r-- | static/netbsd/man3/sqlite3_threadsafe.3 | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/static/netbsd/man3/sqlite3_threadsafe.3 b/static/netbsd/man3/sqlite3_threadsafe.3 new file mode 100644 index 00000000..64e1ac03 --- /dev/null +++ b/static/netbsd/man3/sqlite3_threadsafe.3 @@ -0,0 +1,59 @@ +.Dd January 24, 2024 +.Dt SQLITE3_THREADSAFE 3 +.Os +.Sh NAME +.Nm sqlite3_threadsafe +.Nd test to see if the library is threadsafe +.Sh SYNOPSIS +.In sqlite3.h +.Ft int +.Fo sqlite3_threadsafe +.Fa "void" +.Fc +.Sh DESCRIPTION +The sqlite3_threadsafe() function returns zero if and only if SQLite +was compiled with mutexing code omitted due to the SQLITE_THREADSAFE +compile-time option being set to 0. +.Pp +SQLite can be compiled with or without mutexes. +When the SQLITE_THREADSAFE C preprocessor macro is +1 or 2, mutexes are enabled and SQLite is threadsafe. +When the SQLITE_THREADSAFE macro is 0, the mutexes +are omitted. +Without the mutexes, it is not safe to use SQLite concurrently from +more than one thread. +.Pp +Enabling mutexes incurs a measurable performance penalty. +So if speed is of utmost importance, it makes sense to disable the +mutexes. +But for maximum safety, mutexes should be enabled. +The default behavior is for mutexes to be enabled. +.Pp +This interface can be used by an application to make sure that the +version of SQLite that it is linking against was compiled with the +desired setting of the SQLITE_THREADSAFE macro. +.Pp +This interface only reports on the compile-time mutex setting of the +SQLITE_THREADSAFE flag. +If SQLite is compiled with SQLITE_THREADSAFE=1 or =2 then mutexes are +enabled by default but can be fully or partially disabled using a call +to +.Fn sqlite3_config +with the verbs SQLITE_CONFIG_SINGLETHREAD, +SQLITE_CONFIG_MULTITHREAD, or SQLITE_CONFIG_SERIALIZED. +The return value of the sqlite3_threadsafe() function shows only the +compile-time setting of thread safety, not any run-time changes to +that setting made by sqlite3_config(). +In other words, the return value from sqlite3_threadsafe() is unchanged +by calls to sqlite3_config(). +.Pp +See the threading mode documentation for additional information. +.Sh IMPLEMENTATION NOTES +These declarations were extracted from the +interface documentation at line 221. +.Bd -literal +SQLITE_API int sqlite3_threadsafe(void); +.Ed +.Sh SEE ALSO +.Xr sqlite3_config 3 , +.Xr SQLITE_CONFIG_SINGLETHREAD 3 |
