On Wed, 14 Jun 2000, Dr Wes Munsil wrote:

> The patch I ended up with to solve the Solaris deadlock issue combines
> Jiang Wu's patch and the removal of all MonitorEnter and MonitorExit
> calls. The diffs between TclBlend 1.2.5 and my version are at
> http://idd.com/~wes/tclblendpatch. Note also that the class
> tcl.lang.NativeLock may now be removed.


I like the idea of using a Tcl mutex, but I don't think I am
ready to throw out the existing monitor code just yet. I
made a change to the CVS version that will make it a lot
easier to remove all locking by just doing a #define of
JAVA_LOCK to nothing.

Like so:

#define JAVA_LOCK() \
{ \
    (*env)->MonitorEnter(env, java.NativeLock); \
}

#define JAVA_UNLOCK() \
{ \
    (*env)->MonitorExit(env, java.NativeLock); \
}

#define PUSH_JAVA_ENV() \
{ \
    JAVA_LOCK(); \
    oldEnv = JavaSetEnv(env); \
}

#define POP_JAVA_ENV()  \
{ \
    JavaSetEnv(oldEnv); \
    JAVA_UNLOCK(); \
}


I need to get some good test cases together
before I will feel safe checking in changes
that really overhauling the rest of the
locking stuff.

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