Tcl Source Code

View Ticket
Login
Ticket UUID: 1628986
Title: Threads can't access vfs from starpack
Type: Bug Created on: 2007-01-05 18:42:44
Submitter: nobody Assigned to: vincentdarley
Subsystem: 37. File System Severity:
Priority: 5 Medium Last modified: 2007-02-09 07:56:50
Status: Closed Closed by: hobbs
Resolution: Fixed Closed on: 2007-02-09 00:56:50
Version: obsolete: 8.4.14
Description:
As of 8.4.14, there is a chicken-and-egg problem with threads and the starpack vfs. 

Threads now must explicitly mount any vfs's that they wish to use, as the mounts are no longer implicilty shared.  In  order for a thread to mount a vfs, it must package require the appropriate vfs package.  However in the case of a starpack, the package needed to mount the starpack's vfs (vfs::mk4) is in the starpack itself.  

The following files built into a starpack demonstrate the problem.

=======
file: test.vfs/main.tcl

package require starkit
starkit::startup

package require Thread

set foo [file join [info nameofexecutable] foo.tcl]
 
source $foo

set t [thread::create {thread::wait}]

# thread::send $t { #what goes here to give the thread access foo.tcl located in the starpack's vfs" }
thread::send $t [list source $foo]

=======
file: test.vfs/foo.tcl

puts "hello world from [thread::id]"
User Comments:
hobbs added on 2007-02-09 07:56:50:
Logged In: YES 
user_id=72656
Originator: NO

Fixed in boot.tcl of starpacks.