Tcl package Thread source code

Check-in [b8d3e72748]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Use tcl_platform(threaded) on Tcl8.4 and [::tcl::pkgconfig get threaded] on higher Tcl version, for testing whether Tcl is compiled with threads support.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | thread-2-7for84+
Files: files | file ages | folders
SHA1: b8d3e72748341eaf6efda13598601b23c64f2bc8
User & Date: jan.nijtmans 2012-11-06 15:45:01
Context
2012-11-06
15:50
... But only do "package ifneeded Thread" when tread support for Tcl is already determined. Closed-Leaf check-in: 0da0b1fa18 user: jan.nijtmans tags: thread-2-7for84+
15:45
Use tcl_platform(threaded) on Tcl8.4 and [::tcl::pkgconfig get threaded] on higher Tcl version, for testing whether Tcl is compiled with threads support. check-in: b8d3e72748 user: jan.nijtmans tags: thread-2-7for84+
14:38
better alignment.

Autoconf-2.59

check-in: f22a41b1f0 user: jan.nijtmans tags: thread-2-7for84+
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pkgIndex.tcl.in.

1
2
3
4
5
6
7
8
9
10
11



12
13
14
15
16
17
18
..
23
24
25
26
27
28
29


30
31
32
33
34
35
36
# -*- tcl -*-
# Tcl package index file, version 1.1
#
if {[array names ::tcl_platform threaded] != "threaded"} return

if {[package vsatisfies [package provide Tcl] 8.4]} {

    package ifneeded Thread @[email protected] [list load [file join $dir @[email protected]]]

    if {[llength [info commands apply]]} {
	# We can use a lambda (anon function).




	package ifneeded Ttrace @[email protected] [list ::apply {{dir} {
	    if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
		[file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
		source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl
	    } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} {
		source [file join $dir .. lib ttrace.tcl]
................................................................................
		ttrace::update
	    }
	}} $dir]
    } else {
	# No anon functions available, go with the necessary evil of a
	# named procedure, but use package specific prefix and no
	# hardwired data changing between package versions.



	package ifneeded Ttrace @[email protected] [list @[email protected]_source $dir]

	proc @[email protected]_source {dir} {
	    if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
		[file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
		source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl


<
<





|
>
>
>







 







>
>







1
2
3


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- tcl -*-
# Tcl package index file, version 1.1
#


if {[package vsatisfies [package provide Tcl] 8.4]} {

    package ifneeded Thread @[email protected] [list load [file join $dir @[email protected]]]

    if {[llength [info commands apply]]} {
	# We can use a lambda (anon function) and ::tcl::pkgconfig

	if {([info commands ::tcl::pkgconfig] eq "")
		|| ![::tcl::pkgconfig get threaded]} return

	package ifneeded Ttrace @[email protected] [list ::apply {{dir} {
	    if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
		[file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
		source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl
	    } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} {
		source [file join $dir .. lib ttrace.tcl]
................................................................................
		ttrace::update
	    }
	}} $dir]
    } else {
	# No anon functions available, go with the necessary evil of a
	# named procedure, but use package specific prefix and no
	# hardwired data changing between package versions.

	if {[array names ::tcl_platform threaded] != "threaded"} return

	package ifneeded Ttrace @[email protected] [list @[email protected]_source $dir]

	proc @[email protected]_source {dir} {
	    if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
		[file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
		source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl