Changes to Makefile.in.
Changes to README.
Changes to aclocal.m4.
Deleted aolserver.m4.
Changes to configure.
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
+
|
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for thread 2.7b1.
# Generated by GNU Autoconf 2.59 for thread 2.7.0.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
|
︙ | | |
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
|
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
|
-
-
+
+
|
# This variable seems obsolete. It should probably be removed, and
# only ac_max_sed_lines should be used.
: ${ac_max_here_lines=38}
# Identity of this package.
PACKAGE_NAME='thread'
PACKAGE_TARNAME='thread'
PACKAGE_VERSION='2.7b1'
PACKAGE_STRING='thread 2.7b1'
PACKAGE_VERSION='2.7.0'
PACKAGE_STRING='thread 2.7.0'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
|
︙ | | |
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
|
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
|
-
+
|
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures thread 2.7b1 to adapt to many kinds of systems.
\`configure' configures thread 2.7.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
|
︙ | | |
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
|
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
|
-
+
-
+
|
cat <<\_ACEOF
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of thread 2.7b1:";;
short | recursive ) echo "Configuration of thread 2.7.0:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-threads build with threads
--enable-shared build and link with shared libraries (default: on)
--enable-64bit enable 64bit support (default: off)
--enable-64bit-vis enable 64bit Sparc VIS support (default: off)
--disable-rpath disable rpath support (default: on)
--enable-wince enable Win/CE support (where applicable)
--enable-symbols build with debugging symbols (default: off)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-tcl directory containing tcl configuration
(tclConfig.sh)
--with-gdbm link with optional GDBM support
--with-aolserver directory with AOLserver distribution
--with-naviserver directory with NaviServer/AOLserver distribution
--with-tclinclude directory containing the public Tcl header files
--with-celib=DIR use Windows/CE support library from DIR
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
|
︙ | | |
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
|
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
|
-
+
-
+
|
cd $ac_popdir
done
fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
thread configure 2.7b1
thread configure 2.7.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit 0
fi
exec 5>config.log
cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by thread $as_me 2.7b1, which was
It was created by thread $as_me 2.7.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
_ACEOF
{
cat <<_ASUNAME
|
︙ | | |
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
|
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
|
-
+
-
+
-
-
+
+
-
+
-
|
if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
{ { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
{ { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
Found config for Tcl ${TCL_VERSION}" >&5
echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
Found config for Tcl ${TCL_VERSION}" >&2;}
{ (exit 1); exit 1; }; }
fi
if test "${TCL_MINOR_VERSION}" -lt 6 ; then
{ { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
if test "${TCL_MINOR_VERSION}" -lt 4 ; then
{ { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
Found config for Tcl ${TCL_VERSION}" >&5
echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
Found config for Tcl ${TCL_VERSION}" >&2;}
{ (exit 1); exit 1; }; }
fi
#--------------------------------------------------------------------
# Load the tkConfig.sh file if necessary (Tk extension)
#--------------------------------------------------------------------
#TEA_PATH_TKCONFIG
#TEA_LOAD_TKCONFIG
|
︙ | | |
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
|
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
|
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
-
-
+
+
+
+
-
+
-
+
+
-
+
|
GDBM_LIBS="-L\"$glibdir\" -lgdbm"
fi
fi
fi
#--------------------------------------------------------------------
# Locate the AOLserver dir for compilation as AOLserver module.
# This will declare AOL_INCLUDES, AOL_LIBS and define NS_AOLSERVER.
# Locate the NaviServer/AOLserver dir for compilation as NaviServer/AOLserver module.
# This will declare NS_INCLUDES, NS_LIBS and define NS_AOLSERVER.
#--------------------------------------------------------------------
echo "$as_me:$LINENO: checking for AOLserver configuration" >&5
echo $ECHO_N "checking for AOLserver configuration... $ECHO_C" >&6
echo "$as_me:$LINENO: checking for NaviServer/AOLserver configuration" >&5
echo $ECHO_N "checking for NaviServer/AOLserver configuration... $ECHO_C" >&6
# Check whether --with-aolserver or --without-aolserver was given.
if test "${with_aolserver+set}" = set; then
withval="$with_aolserver"
# Check whether --with-naviserver or --without-naviserver was given.
if test "${with_naviserver+set}" = set; then
withval="$with_naviserver"
\
with_aolserver=${withval}
with_naviserver=${withval}
fi;
if test "${ac_cv_c_aolserver+set}" = set; then
if test "${ac_cv_c_naviserver+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test x"${with_aolserver}" != x ; then
if test -f "${with_aolserver}/include/ns.h" ; then
ac_cv_c_aolserver=`(cd ${with_aolserver}; pwd)`
if test x"${with_naviserver}" != x ; then
if test -f "${with_naviserver}/include/ns.h" ; then
ac_cv_c_naviserver=`(cd ${with_naviserver}; pwd)`
else
{ { echo "$as_me:$LINENO: error: ${with_aolserver} directory doesn't contain ns.h" >&5
echo "$as_me: error: ${with_aolserver} directory doesn't contain ns.h" >&2;}
{ { echo "$as_me:$LINENO: error: ${with_naviserver} directory doesn't contain ns.h" >&5
echo "$as_me: error: ${with_naviserver} directory doesn't contain ns.h" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
fi
if test x"${ac_cv_c_aolserver}" = x ; then
if test x"${ac_cv_c_naviserver}" = x ; then
echo "$as_me:$LINENO: result: none found" >&5
echo "${ECHO_T}none found" >&6
else
AOL_DIR=${ac_cv_c_aolserver}
echo "$as_me:$LINENO: result: found AOLserver in $AOL_DIR" >&5
echo "${ECHO_T}found AOLserver in $AOL_DIR" >&6
AOL_INCLUDES="-I\"${AOL_DIR}/include\""
NS_DIR=${ac_cv_c_naviserver}
echo "$as_me:$LINENO: result: found NaviServer/AOLserver in $NS_DIR" >&5
echo "${ECHO_T}found NaviServer/AOLserver in $NS_DIR" >&6
NS_INCLUDES="-I\"${NS_DIR}/include\""
if test "`uname -s`" = Darwin ; then
aollibs=`ls ${AOL_DIR}/lib/libns* 2>/dev/null`
aollibs=`ls ${NS_DIR}/lib/libns* 2>/dev/null`
if test x"$aollibs" != x ; then
AOL_LIBS="-L\"${AOL_DIR}/lib\" -lnsd -lnsthread"
NS_LIBS="-L\"${NS_DIR}/lib\" -lnsd -lnsthread"
fi
fi
cat >>confdefs.h <<\_ACEOF
#define NS_AOLSERVER 1
_ACEOF
fi
#-----------------------------------------------------------------------
# __CHANGE__
# Specify the C source files to compile in TEA_ADD_SOURCES,
# public headers that need to be installed in TEA_ADD_HEADERS,
# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
# and PKG_TCL_SOURCES.
#-----------------------------------------------------------------------
vars="generic/threadNs.c \
vars="generic/threadCmd.c \
generic/threadCmd.c \
generic/threadSvCmd.c \
generic/threadSpCmd.c \
generic/threadPoolCmd.c \
generic/psGdbm.c \
generic/threadSvListCmd.c \
generic/threadSvKeylistCmd.c \
generic/tclXkeylist.c \
|
︙ | | |
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
|
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
|
-
+
-
+
|
{ (exit 1); exit 1; }; }
fi
PKG_HEADERS="$PKG_HEADERS $i"
done
vars="${AOL_INCLUDES}"
vars="${NS_INCLUDES}"
for i in $vars; do
PKG_INCLUDES="$PKG_INCLUDES $i"
done
vars="${GDBM_LIBS} ${AOL_LIBS}"
vars="${GDBM_LIBS} ${NS_LIBS}"
for i in $vars; do
if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
# Convert foo.lib to -lfoo for GCC. No-op if not *.lib
i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
fi
PKG_LIBS="$PKG_LIBS $i"
done
|
︙ | | |
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
|
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
|
-
+
|
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by thread $as_me 2.7b1, which was
This file was extended by thread $as_me 2.7.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
|
︙ | | |
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
|
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
|
-
+
|
$config_files
Report bugs to <[email protected]>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
thread config.status 2.7b1
thread config.status 2.7.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
|
︙ | | |
Changes to configure.in.
︙ | | |
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
-
+
-
+
-
-
+
+
-
|
# Set your package name and version numbers here.
#
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
# set as provided. These will also be added as -D defs in your Makefile
# so you can encode the package version directly into the source files.
#-----------------------------------------------------------------------
AC_INIT([thread], [2.7b1])
AC_INIT([thread], [2.7.0])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------
TEA_INIT([3.9])
AC_CONFIG_AUX_DIR(tclconfig)
#--------------------------------------------------------------------
# Load the tclConfig.sh file
#--------------------------------------------------------------------
TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG
if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
Found config for Tcl ${TCL_VERSION}])
fi
if test "${TCL_MINOR_VERSION}" -lt 6 ; then
AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+
if test "${TCL_MINOR_VERSION}" -lt 4 ; then
AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.4+
Found config for Tcl ${TCL_VERSION}])
fi
#--------------------------------------------------------------------
# Load the tkConfig.sh file if necessary (Tk extension)
#--------------------------------------------------------------------
#TEA_PATH_TKCONFIG
#TEA_LOAD_TKCONFIG
|
︙ | | |
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
-
-
+
+
-
+
+
-
-
+
+
|
# Check if building with optional Gdbm package. This will declare
# GDBM_CFLAGS and GDBM_LIBS variables.
#--------------------------------------------------------------------
TCLTHREAD_WITH_GDBM
#--------------------------------------------------------------------
# Locate the AOLserver dir for compilation as AOLserver module.
# This will declare AOL_INCLUDES, AOL_LIBS and define NS_AOLSERVER.
# Locate the NaviServer/AOLserver dir for compilation as NaviServer/AOLserver module.
# This will declare NS_INCLUDES, NS_LIBS and define NS_AOLSERVER.
#--------------------------------------------------------------------
NS_PATH_AOLSERVER
#-----------------------------------------------------------------------
# __CHANGE__
# Specify the C source files to compile in TEA_ADD_SOURCES,
# public headers that need to be installed in TEA_ADD_HEADERS,
# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
# and PKG_TCL_SOURCES.
#-----------------------------------------------------------------------
TEA_ADD_SOURCES([generic/threadCmd.c \
TEA_ADD_SOURCES([generic/threadNs.c \
generic/threadCmd.c \
generic/threadSvCmd.c \
generic/threadSpCmd.c \
generic/threadPoolCmd.c \
generic/psGdbm.c \
generic/threadSvListCmd.c \
generic/threadSvKeylistCmd.c \
generic/tclXkeylist.c \
])
TEA_ADD_HEADERS([generic/tclThread.h])
TEA_ADD_INCLUDES([${AOL_INCLUDES}])
TEA_ADD_LIBS([${GDBM_LIBS} ${AOL_LIBS}])
TEA_ADD_INCLUDES([${NS_INCLUDES}])
TEA_ADD_LIBS([${GDBM_LIBS} ${NS_LIBS}])
TEA_ADD_CFLAGS([${GDBM_CFLAGS}])
TEA_ADD_STUB_SOURCES([])
TEA_ADD_TCL_SOURCES([lib/ttrace.tcl])
#--------------------------------------------------------------------
# __CHANGE__
# A few miscellaneous platform-specific items:
|
︙ | | |
Deleted generic/aolstub.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
/*
* aolstub.cpp --
*
* Adds interface for loading the extension into the AOLserver.
*
* Copyright (c) 2002 by Zoran Vasiljevic.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
* ---------------------------------------------------------------------------
*/
#ifdef NS_AOLSERVER
#include <ns.h>
int Ns_ModuleVersion = 1;
/*
* Structure to pass to NsThread_Init. This holds the module
* and virtual server name for proper interp initializations.
*/
struct mydata {
char *modname;
char *server;
};
/*
*----------------------------------------------------------------------------
*
* NsThread_Init --
*
* Loads the package for the first time, i.e. in the startup thread.
*
* Results:
* Standard Tcl result
*
* Side effects:
* Package initialized. Tcl commands created.
*
*----------------------------------------------------------------------------
*/
static int
NsThread_Init (Tcl_Interp *interp, void *cd)
{
struct mydata *md = (struct mydata*)cd;
int ret = Thread_Init(interp);
if (ret != TCL_OK) {
Ns_Log(Warning, "can't load module %s: %s", md->modname,
Tcl_GetStringResult(interp));
return TCL_ERROR;
}
Tcl_SetAssocData(interp, "thread:nsd", NULL, (ClientData)md);
return TCL_OK;
}
/*
*----------------------------------------------------------------------------
*
* Ns_ModuleInit --
*
* Called by the AOLserver when loading shared object file.
*
* Results:
* Standard AOLserver result
*
* Side effects:
* Many. Depends on the package.
*
*----------------------------------------------------------------------------
*/
int
Ns_ModuleInit(char *srv, char *mod)
{
struct mydata *md = NULL;
md = (struct mydata*)ns_malloc(sizeof(struct mydata));
md->modname = strcpy(ns_malloc(strlen(mod)+1), mod);
md->server = strcpy(ns_malloc(strlen(srv)+1), srv);
return Ns_TclRegisterTrace(srv, NsThread_Init, (void*)md, NS_TCL_TRACE_CREATE);
}
#endif /* NS_AOLSERVER */
/* EOF $RCSfile: aolstub.cpp,v $ */
/* Emacs Setup Variables */
/* Local Variables: */
/* mode: C */
/* indent-tabs-mode: nil */
/* c-basic-offset: 4 */
/* End: */
|
Changes to generic/tclThreadInt.h.
Changes to generic/threadCmd.c.
︙ | | |
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
|
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
* ----------------------------------------------------------------------------
*/
#include "tclThreadInt.h"
/*
* Check if this is Tcl 8.5 or higher. In that case, we will have the TIP
* #143 APIs (i.e. interpreter resource limiting) available.
*/
#define haveInterpLimit (tclVersion>84)
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 5)
# define Tcl_LimitExceeded ((int (*)(Tcl_Interp *)) \
((&(tclStubsPtr->tcl_PkgProvideEx))[524]))
#endif
#ifdef NS_AOLSERVER
# include "aolstub.cpp"
/*
* Check if this is Tcl 8.6 or higher. In that case, we will have the TIP
* #285 APIs (i.e. asynchronous script cancellation) available.
*/
#define haveInterpCancel (tclVersion>85)
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
# define TCL_CANCEL_UNWIND 0x100000
# define Tcl_CancelEval ((int (*)(Tcl_Interp *, Tcl_Obj *, ClientData, int)) \
((&(tclStubsPtr->tcl_PkgProvideEx))[580]))
# define Tcl_Canceled ((int (*)(Tcl_Interp *, int)) \
((&(tclStubsPtr->tcl_PkgProvideEx))[581]))
#endif
/*
* Access to the list of threads and to the thread send results
* (defined below) is guarded by this mutex.
*/
|
︙ | | |
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
+
+
|
static struct ThreadSpecificData *threadList = NULL;
/*
* Used to represent the empty result.
*/
static char *threadEmptyResult = (char *)"";
static int tclVersion = 0;
/*
* An instance of the following structure contains all information that is
* passed into a new thread when the thread is created using either the
* "thread create" Tcl command or the ThreadCreate() C function.
*/
|
︙ | | |
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
|
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
|
-
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
|
static Tcl_ObjCmdProc ThreadAttachObjCmd;
static Tcl_ObjCmdProc ThreadCancelObjCmd;
static int
ThreadInit(interp)
Tcl_Interp *interp; /* The current Tcl interpreter */
{
int tclIsThreaded = 0;;
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
return TCL_ERROR;
}
if (Tcl_Eval(interp, "::tcl::pkgconfig get threaded") != TCL_OK
|| Tcl_GetBooleanFromObj(interp,
Tcl_GetObjResult(interp), &tclIsThreaded) != TCL_OK
|| !tclIsThreaded) {
if (!tclVersion) {
/*
* Perform a version check now to stop using from trying to use
* the TIP #143 or TIP #285 functionality if they are not present.
*/
int major, minor;
Tcl_GetVersion(&major, &minor, NULL, NULL);
tclVersion = 10 * major + minor;
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"Tcl core wasn't compiled for threading.", -1));
return TCL_ERROR;
}
TCL_CMD(interp, THREAD_CMD_PREFIX"create", ThreadCreateObjCmd);
TCL_CMD(interp, THREAD_CMD_PREFIX"send", ThreadSendObjCmd);
TCL_CMD(interp, THREAD_CMD_PREFIX"broadcast", ThreadBroadcastObjCmd);
TCL_CMD(interp, THREAD_CMD_PREFIX"exit", ThreadExitObjCmd);
TCL_CMD(interp, THREAD_CMD_PREFIX"unwind", ThreadUnwindObjCmd);
|
︙ | | |
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
|
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
|
-
-
|
int flags; /* Zero for no flags */
int preserve; /* If true, reserve the thread */
{
char thrHandle[THREAD_HNDLMAXLEN];
ThreadCtrl ctrl;
Tcl_ThreadId thrId;
#ifdef NS_AOLSERVER
ctrl.cd = Tcl_GetAssocData(interp, "thread:nsd", NULL);
#endif
ctrl.script = (char *)script;
ctrl.condWait = NULL;
ctrl.flags = 0;
Tcl_MutexLock(&threadMutex);
if (Tcl_CreateThread(&thrId, NewThread, (ClientData)&ctrl,
stacksize, flags) != TCL_OK) {
|
︙ | | |
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
|
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
|
+
+
+
+
+
|
if (tsdPtr == (ThreadSpecificData*)NULL) {
Tcl_MutexUnlock(&threadMutex);
ErrorNoSuchThread(interp, thrId);
return TCL_ERROR;
}
Tcl_MutexUnlock(&threadMutex);
if (!haveInterpCancel) {
Tcl_AppendResult(interp, "not supported with this Tcl version", NULL);
return TCL_ERROR;
}
return Tcl_CancelEval(tsdPtr->interp,
(result != NULL) ? Tcl_NewStringObj(result, -1) : NULL, 0, flags);
}
/*
*----------------------------------------------------------------------
|
︙ | | |
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
|
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
|
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
|
* a script in progress to be canceled or exceed its limit;
* therefore, check for these conditions if we are able to
* (i.e. we are running in a high enough version of Tcl).
*/
Tcl_DoOneEvent(TCL_ALL_EVENTS);
if (haveInterpCancel) {
/*
* If the script has been unwound, bail out immediately. This does
* not follow the recommended guidelines for how extensions should
* handle the script cancellation functionality because this is
* not a "normal" extension. Most extensions do not have a command
* that simply enters an infinite Tcl event loop. Normal extensions
* should not specify the TCL_CANCEL_UNWIND when calling the
* Tcl_Canceled function to check if the command has been canceled.
*/
/*
* If the script has been unwound, bail out immediately. This does
* not follow the recommended guidelines for how extensions should
* handle the script cancellation functionality because this is
* not a "normal" extension. Most extensions do not have a command
* that simply enters an infinite Tcl event loop. Normal extensions
* should not specify the TCL_CANCEL_UNWIND when calling the
* Tcl_Canceled function to check if the command has been canceled.
*/
if (Tcl_Canceled(tsdPtr->interp,
TCL_LEAVE_ERR_MSG | TCL_CANCEL_UNWIND) == TCL_ERROR) {
code = TCL_ERROR;
break;
}
if (Tcl_LimitExceeded(tsdPtr->interp)) {
code = TCL_ERROR;
break;
if (Tcl_Canceled(tsdPtr->interp,
TCL_LEAVE_ERR_MSG | TCL_CANCEL_UNWIND) == TCL_ERROR) {
code = TCL_ERROR;
break;
}
}
if (haveInterpLimit) {
if (Tcl_LimitExceeded(tsdPtr->interp)) {
code = TCL_ERROR;
break;
}
}
/*
* Test stop condition under mutex since
* some other thread may flip our flags.
*/
|
︙ | | |
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
|
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
|
-
+
|
if (threadEvalScript && threadEvalScript != threadEmptyResult) {
Tcl_Free((char*)threadEvalScript);
}
Tcl_MutexLock(&threadMutex);
/*
* AOLserver and threadpool threads get started/stopped
* NaviServer/AOLserver and threadpool threads get started/stopped
* out of the control of this interface so this is
* the first chance to split them out of the thread list.
*/
ListRemoveInner(tsdPtr);
/*
|
︙ | | |
Added generic/threadNs.c.