Re: Re: starkit-lite and threads: can't package require

Uwe Koloska <[email protected]> Sat, 25 Aug 2012 02:12:56 +0200
Newsgroups gmane.comp.lang.tcl.starkit
Message-ID <[email protected]>
Hello Hermann,

Am Dienstag, 21. August 2012 schrieb Hermann Boeken:
> have you ever found the solution to this problem?

At least I have found something that works for my app -- YMMV!

> I have a similar problem here.
> I want to package a threaded application as starpack, but none of my
> threads have access to the Tcl packages within the app's vfs then.

Here is my version of the thread init-function that does the trick for me:

#+BEGIN_SRC Tcl
package require Thread
proc threadvfs {} {
    if {[info exists starkit::mode] && $starkit::mode ne "unwrapped"} {
	set self $starkit::topdir
	append data "vfs::mk4::Mount \"$self\" \"$self\" -readonly\n"
    }
    append data "set ::auto_path [list $::auto_path]\n"
    append data "thread::wait"

    return [thread::create $data]
}
#+END_SRC

Hope this helps
Uwe

-- 
You received this message because you are subscribed to the "starkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/starkit?hl=en