Tcl package Thread source code

Check-in [1a145a8728]
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Revert previous commit, since the restriction complained about is intentional. So, make it extra clear that Thread 3.0 is only supported with Tcl 9.0!
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1a145a87287eb9c5478c3ef3dff750c80afd05eb83cfacda407a816f9002e82d
User & Date: jan.nijtmans 2020-03-12 09:07:38
Context
2020-05-22
08:00
Merge 2.9 check-in: 0e6d3a65a2 user: jan.nijtmans tags: trunk
2020-03-12
09:07
Revert previous commit, since the restriction complained about is intentional. So, make it extra clear that Thread 3.0 is only supported with Tcl 9.0! check-in: 1a145a8728 user: jan.nijtmans tags: trunk
2020-03-11
21:44
Fix platform detection checks that intended to block use of Thread package on platforms with a pointer size of less than 32 bits but inadvertently also blocked 64-bit platforms. check-in: c1a7d4820b user: pooryorick tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to configure.

3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497





if test "${TCL_MAJOR_VERSION}" -eq 8 ; then
    if test "${TCL_MINOR_VERSION}" -lt 7 ; then
        as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+
Found config for Tcl ${TCL_VERSION}" "$LINENO" 5
fi
fi

#--------------------------------------------------------------------
# Load the tkConfig.sh file if necessary (Tk extension)
#--------------------------------------------------------------------







|







3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497





if test "${TCL_MAJOR_VERSION}" -eq 8 ; then
    if test "${TCL_MINOR_VERSION}" -lt 7 ; then
        as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 9.0+
Found config for Tcl ${TCL_VERSION}" "$LINENO" 5
fi
fi

#--------------------------------------------------------------------
# Load the tkConfig.sh file if necessary (Tk extension)
#--------------------------------------------------------------------

Changes to configure.ac.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#--------------------------------------------------------------------

TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG

if test "${TCL_MAJOR_VERSION}" -eq 8 ; then
    if test "${TCL_MINOR_VERSION}" -lt 7 ; then
        AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+
Found config for Tcl ${TCL_VERSION}])
fi
fi

#--------------------------------------------------------------------
# Load the tkConfig.sh file if necessary (Tk extension)
#--------------------------------------------------------------------







|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#--------------------------------------------------------------------

TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG

if test "${TCL_MAJOR_VERSION}" -eq 8 ; then
    if test "${TCL_MINOR_VERSION}" -lt 7 ; then
        AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 9.0+
Found config for Tcl ${TCL_VERSION}])
fi
fi

#--------------------------------------------------------------------
# Load the tkConfig.sh file if necessary (Tk extension)
#--------------------------------------------------------------------

Changes to generic/threadCmd.c.

368
369
370
371
372
373
374










375
376
377
378
379
380
381
382
static int
ThreadInit(
    Tcl_Interp *interp /* The current Tcl interpreter */
) {
    /* Tcl 8.7 interps are only supported on 32-bit machines.
     * Lower than that is never supported. Bye!
     */










    const char *ver = (sizeof(size_t) >= sizeof(int))? "8.7-": "9.0";

    if (!((Tcl_InitStubs)(interp, ver, (TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16),
	    TCL_STUB_MAGIC))) {
	return TCL_ERROR;
    }

    if (threadMutex == NULL){







>
>
>
>
>
>
>
>
>
>
|







368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
static int
ThreadInit(
    Tcl_Interp *interp /* The current Tcl interpreter */
) {
    /* Tcl 8.7 interps are only supported on 32-bit machines.
     * Lower than that is never supported. Bye!
     */
#if defined(TCL_WIDE_INT_IS_LONG) && TCL_MAJOR_VERSION < 9
#   error "Thread 3.0 is only supported with Tcl 9.0 and higher."
#	error "Please use Thread 2.8 (branch thread-2-8-branch)"
#endif

	/* Even though it's not supported, Thread 3.0 works with Tcl 8.7
	 * on 32-bit platforms, so allow that for now. It could be that
	 * Tcl 9.0 introduces a further binary incompatibility in the
	 * future, so this is not guaranteed to stay like it is now!
	 */
    const char *ver = (sizeof(size_t) == sizeof(int))? "8.7-": "9.0";

    if (!((Tcl_InitStubs)(interp, ver, (TCL_MAJOR_VERSION<<8)|(TCL_MINOR_VERSION<<16),
	    TCL_STUB_MAGIC))) {
	return TCL_ERROR;
    }

    if (threadMutex == NULL){

Changes to pkgIndex.tcl.in.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Tcl package index file, version 1.1
#

# Tcl 8.7 interps are only supported on 32-bit platforms.
# Lower than that is never supported. Bye!
if {![package vsatisfies [package provide Tcl] 9.0]
	&& ((![package vsatisfies [package provide Tcl] 8.7])
	|| ($::tcl_platform(pointerSize)<4))} {
    return
}

# All Tcl 8.7+ interps can [load] Thread @PACKAGE_VERSION@
#
# For interps that are not thread-enabled, we still call [package ifneeded].
# This is contrary to the usual convention, but is a good idea because we







|







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Tcl package index file, version 1.1
#

# Tcl 8.7 interps are only supported on 32-bit platforms.
# Lower than that is never supported. Bye!
if {![package vsatisfies [package provide Tcl] 9.0]
	&& ((![package vsatisfies [package provide Tcl] 8.7])
	|| ($::tcl_platform(pointerSize)!=4))} {
    return
}

# All Tcl 8.7+ interps can [load] Thread @PACKAGE_VERSION@
#
# For interps that are not thread-enabled, we still call [package ifneeded].
# This is contrary to the usual convention, but is a good idea because we