1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-09 10:21:35 +03:00

Add the experimental sqlite3_threadsafe() API. (CVS 4350)

FossilOrigin-Name: 1b39a714efbe1f4ccc8daf68a227a8c9b84a388f
This commit is contained in:
drh
2007-08-30 20:09:48 +00:00
parent ad3e78b671
commit b67e8bf071
4 changed files with 35 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
C Fix\sthe\sloadable\sextension\smodule\sso\sthat\sit\swill\scompile\swith\nSQLITE_THREADSAFE=0.\s(CVS\s4349) C Add\sthe\sexperimental\ssqlite3_threadsafe()\sAPI.\s(CVS\s4350)
D 2007-08-30T20:09:28 D 2007-08-30T20:09:48
F Makefile.in bfcc303429a5d9dcd552d807ee016c77427418c3 F Makefile.in bfcc303429a5d9dcd552d807ee016c77427418c3
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -99,7 +99,7 @@ F src/journal.c 573911e274738b3fda813d4f0a6e319f8a9ecd36
F src/legacy.c 4ac53191fad2e3c4d59bde1228879b2dc5a96d66 F src/legacy.c 4ac53191fad2e3c4d59bde1228879b2dc5a96d66
F src/limits.h 71ab25f17e35e0a9f3f6f234b8ed49cc56731d35 F src/limits.h 71ab25f17e35e0a9f3f6f234b8ed49cc56731d35
F src/loadext.c 9e6bbbc0955c882a2ef11c88d6a0896d2e7b02a4 F src/loadext.c 9e6bbbc0955c882a2ef11c88d6a0896d2e7b02a4
F src/main.c 9276bbdc90d17cd8b15c4cb227dc09c968779391 F src/main.c 80ebc68e5a270e55b06b233ac475b6c56b11ec17
F src/malloc.c de4e77fe70a9a0ac47a1c3a874422b107231bf31 F src/malloc.c de4e77fe70a9a0ac47a1c3a874422b107231bf31
F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217
F src/mem1.c afe2fbf6d7e8247c6c9f69c1481358b1cad60c08 F src/mem1.c afe2fbf6d7e8247c6c9f69c1481358b1cad60c08
@@ -130,7 +130,7 @@ F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da
F src/select.c e5cc50e8d22b2490c4fb47f2ef08a9b43bcb52d9 F src/select.c e5cc50e8d22b2490c4fb47f2ef08a9b43bcb52d9
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c ac29402b538515fa4697282387be9c1205e6e9eb F src/shell.c ac29402b538515fa4697282387be9c1205e6e9eb
F src/sqlite.h.in cc69ce66ee2b9d9bf2637ae4769d1c4891e1a0d1 F src/sqlite.h.in b4cca54d8c3aa61c033dcb0d48f11ebcdb354627
F src/sqlite3ext.h 3e5368b64a28602ef8abf9cfb6c8c1643903f238 F src/sqlite3ext.h 3e5368b64a28602ef8abf9cfb6c8c1643903f238
F src/sqliteInt.h 5dbb7a934a88dfa9893e2627f4821b0464f5edc0 F src/sqliteInt.h 5dbb7a934a88dfa9893e2627f4821b0464f5edc0
F src/sqliteLimit.h 1bcbbdfa856f8b71b561abb31edb864b0eca1d12 F src/sqliteLimit.h 1bcbbdfa856f8b71b561abb31edb864b0eca1d12
@@ -568,7 +568,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 65c62ed85edd2cb3cf26f01fadf3b342c1e8a20f P a73a8b50f76f4f948a4080070ac2354d8ea05515
R 24707d1f16c4f01b815be9447025b12b R c4d79d2cd68f00b0062f4ecfacc90065
U drh U drh
Z 13c6d55075c5cdd960d7fb6e3991b863 Z 40195c533200bec4568da6a8f5f748e2

View File

@@ -1 +1 @@
a73a8b50f76f4f948a4080070ac2354d8ea05515 1b39a714efbe1f4ccc8daf68a227a8c9b84a388f

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be ** other files are for internal use by SQLite and should not be
** accessed by users of the library. ** accessed by users of the library.
** **
** $Id: main.c,v 1.399 2007/08/30 16:23:19 drh Exp $ ** $Id: main.c,v 1.400 2007/08/30 20:09:48 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@@ -25,6 +25,7 @@
const char sqlite3_version[] = SQLITE_VERSION; const char sqlite3_version[] = SQLITE_VERSION;
const char *sqlite3_libversion(void){ return sqlite3_version; } const char *sqlite3_libversion(void){ return sqlite3_version; }
int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
/* /*
** If the following function pointer is not NULL and if ** If the following function pointer is not NULL and if

View File

@@ -30,7 +30,7 @@
** the version number) and changes its name to "sqlite3.h" as ** the version number) and changes its name to "sqlite3.h" as
** part of the build process. ** part of the build process.
** **
** @(#) $Id: sqlite.h.in,v 1.250 2007/08/30 16:23:19 drh Exp $ ** @(#) $Id: sqlite.h.in,v 1.251 2007/08/30 20:09:48 drh Exp $
*/ */
#ifndef _SQLITE3_H_ #ifndef _SQLITE3_H_
#define _SQLITE3_H_ #define _SQLITE3_H_
@@ -112,6 +112,30 @@ SQLITE_EXTERN const char sqlite3_version[];
const char *sqlite3_libversion(void); const char *sqlite3_libversion(void);
int sqlite3_libversion_number(void); int sqlite3_libversion_number(void);
/*
** CAPI3REF: Test To See If The Library Is Threadsafe
**
** This routine returns TRUE (nonzero) if SQLite was compiled with
** all of its mutexes enabled and is thus threadsafe. It returns
** zero if the particular build is for single-threaded operation
** only.
**
** Really all this routine does is return true if SQLite was compiled
** with the -DSQLITE_THREADSAFE=1 option and false if
** compiled with -DSQLITE_THREADSAFE=0. If SQLite uses an
** application-defined mutex subsystem, malloc subsystem, collating
** sequence, VFS, SQL function, progress callback, commit hook,
** extension, or other accessories and these add-ons are not
** threadsafe, then clearly the combination will not be threadsafe
** either. Hence, this routine never reports that the library
** is guaranteed to be threadsafe, only when it is guaranteed not
** to be.
**
** This is an experimental API and may go away or change in future
** releases.
*/
int sqlite3_threadsafe(void);
/* /*
** CAPI3REF: Database Connection Handle ** CAPI3REF: Database Connection Handle
** **