From: drh Date: Thu, 24 Nov 2005 23:14:00 +0000 (+0000) Subject: The --enable-cross-thread-connect configuration option or the X-Git-Tag: version-3.3.0~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91636d58c0659c4d769f81891885b5dea7d55bcf;p=thirdparty%2Fsqlite.git The --enable-cross-thread-connect configuration option or the -DSQLITE_ALLOW_XTHREAD_CONNECT compile-time option permits database connections to be moved across threads. This will cause latch-ups and failures on some linux systems such as RedHat-9. Do not use these options if you want a portable build. (CVS 2778) FossilOrigin-Name: 84aa4d58001ed943295f21f429c58c3c99b771d8 --- diff --git a/Makefile.in b/Makefile.in index e6dbc4e51e..78684bbd52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,7 +32,7 @@ TCC = @TARGET_CC@ @TARGET_CFLAGS@ -I. -I${TOP}/src # Omitting the define will cause extra debugging code to be inserted and # includes extra comments when "EXPLAIN stmt" is used. # -TCC += @TARGET_DEBUG@ +TCC += @TARGET_DEBUG@ @XTHREADCONNECT@ # Compiler options needed for programs that use the TCL library. # @@ -106,7 +106,7 @@ LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) # You should not have to change anything below this line ############################################################################### - +OPTS = OPTS += -DSQLITE_OMIT_CURSOR # Cursors do not work at this time TCC += -DSQLITE_OMIT_CURSOR diff --git a/configure b/configure index 5be315aac0..89e956b4c7 100755 --- a/configure +++ b/configure @@ -463,7 +463,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA program_prefix VERSION RELEASE VERSION_NUMBER BUILD_CC BUILD_CFLAGS BUILD_LIBS TARGET_CC TARGET_CFLAGS TARGET_LINK TARGET_LFLAGS TARGET_RANLIB TARGET_AR THREADSAFE TARGET_THREAD_LIB ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN TARGET_EXEEXT TARGET_LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIBS TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC HAVE_TCL TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE TARGET_DEBUG LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA program_prefix VERSION RELEASE VERSION_NUMBER BUILD_CC BUILD_CFLAGS BUILD_LIBS TARGET_CC TARGET_CFLAGS TARGET_LINK TARGET_LFLAGS TARGET_RANLIB TARGET_AR THREADSAFE TARGET_THREAD_LIB XTHREADCONNECT ALLOWRELEASE TEMP_STORE BUILD_EXEEXT OS_UNIX OS_WIN TARGET_EXEEXT TARGET_LIBS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIBS TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC HAVE_TCL TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE TARGET_DEBUG LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1026,6 +1026,7 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-threadsafe Support threadsafe operation + --enable-cross-thread-connections Allow connection sharing across threads --enable-releasemode Support libtool link to release mode --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always) --disable-tcl do not build TCL extension @@ -1496,7 +1497,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # The following RCS revision string applies to configure.in -# $Revision: 1.34 $ +# $Revision: 1.35 $ ######### # Programs needed @@ -3055,7 +3056,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3058 "configure"' > conftest.$ac_ext + echo '#line 3059 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4518,7 +4519,7 @@ fi # Provide some information about the compiler. -echo "$as_me:4521:" \ +echo "$as_me:4522:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -5552,11 +5553,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5555: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5556: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5559: \$? = $ac_status" >&5 + echo "$as_me:5560: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -5785,11 +5786,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5788: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5789: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5792: \$? = $ac_status" >&5 + echo "$as_me:5793: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -5845,11 +5846,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5848: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5849: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:5852: \$? = $ac_status" >&5 + echo "$as_me:5853: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8029,7 +8030,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10310: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10313: \$? = $ac_status" >&5 + echo "$as_me:10314: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10366,11 +10367,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10369: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10370: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10373: \$? = $ac_status" >&5 + echo "$as_me:10374: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11727,7 +11728,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12656: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12659: \$? = $ac_status" >&5 + echo "$as_me:12660: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12712,11 +12713,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12715: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12716: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12719: \$? = $ac_status" >&5 + echo "$as_me:12720: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14746,11 +14747,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14749: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14750: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14753: \$? = $ac_status" >&5 + echo "$as_me:14754: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14979,11 +14980,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14982: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14983: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14986: \$? = $ac_status" >&5 + echo "$as_me:14987: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15039,11 +15040,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15042: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15043: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15046: \$? = $ac_status" >&5 + echo "$as_me:15047: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17223,7 +17224,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 +echo $ECHO_N "checking whether to allow connections to be shared across threads... $ECHO_C" >&6 +if test "$enable_xthreadconnect" = "no"; then + XTHREADCONNECT='' + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +else + XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1' + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +fi + + ########## # Do we want to support release # @@ -21135,6 +21161,7 @@ s,@TARGET_RANLIB@,$TARGET_RANLIB,;t t s,@TARGET_AR@,$TARGET_AR,;t t s,@THREADSAFE@,$THREADSAFE,;t t s,@TARGET_THREAD_LIB@,$TARGET_THREAD_LIB,;t t +s,@XTHREADCONNECT@,$XTHREADCONNECT,;t t s,@ALLOWRELEASE@,$ALLOWRELEASE,;t t s,@TEMP_STORE@,$TEMP_STORE,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t diff --git a/configure.ac b/configure.ac index 8ed6baa6d5..42dbab3e11 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,7 @@ AC_INIT(src/sqlite.h.in) dnl Put the RCS revision string after AC_INIT so that it will also dnl show in in configure. # The following RCS revision string applies to configure.in -# $Revision: 1.20 $ +# $Revision: 1.21 $ ######### # Programs needed @@ -299,6 +299,23 @@ else fi AC_SUBST(TARGET_THREAD_LIB) +########## +# Do we want to allow a connection created in one thread to be used +# in another thread. This does not work on many Linux systems (ex: RedHat 9) +# due to bugs in the threading implementations. This is thus off by default. +# +AC_ARG_ENABLE(cross-thread-connections, +[ --enable-cross-thread-connections Allow connection sharing across threads],,enable_xthreadconnect=no) +AC_MSG_CHECKING([whether to allow connections to be shared across threads]) +if test "$enable_xthreadconnect" = "no"; then + XTHREADCONNECT='' + AC_MSG_RESULT([no]) +else + XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1' + AC_MSG_RESULT([yes]) +fi +AC_SUBST(XTHREADCONNECT) + ########## # Do we want to support release # diff --git a/manifest b/manifest index f3893a8514..87df26e4e4 100644 --- a/manifest +++ b/manifest @@ -1,6 +1,6 @@ -C Make\ssure\ssqliteInt.h\sis\sincluded\sbefore\sany\ssystem\sincludes.\nThis\sis\srequired\sfor\sQNX.\s\sTicket\s#1478.\s(CVS\s2777) -D 2005-11-24T22:33:05 -F Makefile.in 38d98f08ec6d3643ec7b2afa1377f677da72c55e +C The\s--enable-cross-thread-connect\sconfiguration\soption\sor\sthe\n-DSQLITE_ALLOW_XTHREAD_CONNECT\scompile-time\soption\spermits\sdatabase\nconnections\sto\sbe\smoved\sacross\sthreads.\s\sThis\swill\scause\slatch-ups\nand\sfailures\son\ssome\slinux\ssystems\ssuch\sas\sRedHat-9.\s\sDo\snot\suse\sthese\noptions\sif\syou\swant\sa\sportable\sbuild.\s(CVS\s2778) +D 2005-11-24T23:14:01 +F Makefile.in 7bed51530f32af7fe1945261c388d80998b39a12 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F VERSION b818cce180263e590a00ad4509a713892c3eecea @@ -12,8 +12,8 @@ F art/SQLite.gif 1bbb94484963f1382e27e1c5e86dd0c1061eba2b F art/SQLiteLogo3.tiff b9e6bf022ae939bc986cddb8ab99583ca1b02cb3 F config.guess 2103e94b15dc57112d7b9ee152c6fac5288895b4 F config.sub 9bf686ec001ae7bc53f5b3563c90c62d4c6d48be -F configure 32b90b38561fe7182d060e390e3fcd1d42a3f357 x -F configure.ac e2d025ec2a3fbb33324f37695403b0220cda8784 +F configure 18b8afcd5b4df4408f19aef75c4f3fc4f0e65623 x +F configure.ac e067b3abb59b29bdb4d784a8c9abb56a797c8da5 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538 F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac @@ -54,7 +54,7 @@ F src/os.h c51f2747f7bd1840447e2c7d26db749604626814 F src/os_common.h d74a11728ad2444b6b695b94c28c06881f049e49 F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 -F src/os_unix.c 2af2d2cea9cc6282c02b48aacf2995193440cf00 +F src/os_unix.c 6878d8aeaa5ddd0c8e8c92b4c36b09c2080fc892 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c fbccc85e7011174068c27d54256746321a1f0059 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b @@ -321,7 +321,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 2dfc9863919c9eb1fd1064ab2817d752dd7f9293 -R 533c39565c0cf38b0eae97eb3134fb99 +P ab76453553bea7c2371b35e7643a98967bb04582 +R 0b4af885de2ca817be0934b37ce5ef2d U drh -Z ffb5c4ad09c7e7bfd6d3c5e381e1247e +Z c8c6cacd38c20efbd6914c121908cdb8 diff --git a/manifest.uuid b/manifest.uuid index e51b7aa41f..df862bea31 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ab76453553bea7c2371b35e7643a98967bb04582 \ No newline at end of file +84aa4d58001ed943295f21f429c58c3c99b771d8 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 270d39888e..ea44217afe 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -81,7 +81,7 @@ ** to another. This logic makes sure a user does not try to do that ** by mistake. */ -#ifdef SQLITE_UNIX_THREADS +#if defined(SQLITE_UNIX_THREADS) && !defined(SQLITE_ALLOW_XTHREAD_CONNECTIONS) # define SET_THREADID(X) X->tid = pthread_self() # define CHECK_THREADID(X) (!pthread_equal(X->tid, pthread_self())) #else