Le lundi 27 novembre 2017 08:07:16 UTC+1, Rolf Schroedter a écrit :
> I am unable to source starkit-wrapped TCL-files from inside a thread.
> Is there such a limitation ?
> That would also mean a thread cannot [packet require] if the package is
> wrapped ...
Hi Rolf,
I had the same problem when loading starkit in several interp.
I have modified the "header" proc in tclvfs starkit.tcl as follow:
# called from the header of a starkit
proc header {driver args} {
if {[catch {
set self [fullnormalize [info script]]
package require vfs::${driver}
# Don't use mounted file as mount point, otherwise it can't be sourced anymore
# because not considered as native file.
# Also, mount file only once.
set mntpoint "$self@vfs"
if {![file exists $mntpoint]} {
::vfs::${driver}::Mount $self $mntpoint {*}$args
}
uplevel [list source [file join $mntpoint main.tcl]]
}]} {
panic $::errorInfo
}
}
Take care that I had to change the mount point, which may lead to problems in your own code if it depends on it.
Don't know if it will fix the problem in different thread, but you can try.
Eric