Patch FYI: Fix PR libgcj/21557

Bryce McKinlay mckinlay@redhat.com
Sat May 14 00:23:00 GMT 2005


This patch fixes PR libgcj/21557.

_Jv_MonitorEnter uses _Jv_Condwait when it needs to expand a lock to 
heavyweight status due to contention. If the thread is interrupted with 
Thread.interrupt() before or during the lock expansion process, 
_Jv_Condwait will return _JV_INTERRUTPED. Because _Jv_MonitorEnter did 
not check for this return value, an infinite loop would result.

This patch fixes the problem by checking for the _JV_INTERRUPTED return 
value and clearing the thread's interrupted status flag. It also 
restores the flag once the lock has been successfully converted.

I'm checking this in to both the HEAD and branch.

Bryce


-------------- next part --------------
A non-text attachment was scrubbed...
Name: libjava-monitor-interrupt.patch
Type: text/x-patch
Size: 1730 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20050514/43522378/attachment.bin>


More information about the Java-patches mailing list