Tcl package Thread source code

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

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c1a7d4820b85cbbfd3f5cae007d151288a1c38be48805071ed581ceec7ff76a9
User & Date: pooryorick 2020-03-11 21:44:11
Context
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
2020-03-06
19:29
Merge 2.9 check-in: 5507a0fde4 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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
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){

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