On Thu, 12 Oct 2000, Daniel Wickstrom wrote:

> >>>>> "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:
> 
> 
>     Mo> There are two cleanup cases.
> 
>     Mo> TclThreadCleanup is called when a Tcl thread (one that was not
>     Mo> started inside a JVM) is terminated. TclThreadCleanup will
>     Mo> just call DetachCurrentThread() to disconnect the Tcl thread
>     Mo> from the JVM.
> 
>     Mo> JavaCacheCleanup should be called when a Java or Tcl thread is
>     Mo> terminated, its job is to clean up the thread local cache or
>     Mo> classes.
> 
> For me these two cases seem to be one in the same.  At the end of a
> connection thread, I need to do both JavaCacheCleanup and
> DetachCurrentThread. 

That would be the case when you created the thread in Tcl
(meaning the JVM did not create the thread).
 
>     Mo> I am not sure which of these you are using because the
>     Mo> description below says "Connection thread starts" and then
>     Mo> "jvm attach to the current connection thread", that would make
>     Mo> me think it is a thread created from Tcl.
> 
> I think what you're saying is correct.  I've always thought of it as
> aolserver starting a connection thread and allocating a tcl
> interpreter instance to run in that thread.  The jvm attach is done at
> the start of the thread by a registered proc, and after the jvm is
> attached to the connection thread, tclblend is initialized.

What do you mean by "The jvm attach is done at the start of the
thread by a registered proc"? Are you not using:

(*javaVM)->AttachCurrentThread()

In JavaInitEnv() to attach the Tcl thread to the JVM?
This is also the place where this is called.

Tcl_CreateThreadExitHandler(TclThreadCleanup, NULL);


Perhaps I am just not understanding what you mean. You
really should not need to do your own JVM attach, at
least that is not something I had considered (ugh,
we don't really need another init case).

Mo DeJong
Red Hat Inc

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to