This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Patch for Review: PR/9254 and other Win32 Threading Fixes


Doesn't this reset the owner field to zero even for a nested _Jv_MutexUnlock call? I suspect you need a count field to correctly maintain the owner field, unless you can somehow get at the one that's already inside the CriticalSection.
Your observation about the potential bug is correct.
Sorry! (And Tom would also chide me for not including a
"Fixes PR java/9254" in the ChangeLog - Sorry again!)

I do not know of a way of getting at the ownership
info inside a CriticalSection and I strongly suspect
that there isn't any, because the API documentation
for LeaveCriticalSection( ) should not then say:

"[...]If a thread calls LeaveCriticalSection when it does not have ownership of the specified critical section object, an error occurs that may cause another thread using EnterCriticalSection to wait indefinitely."

(http://msdn.microsoft.com/library/en-us/dllproc/base/leavecriticalsection.asp)

I will resubmit this patch soon with the above bugs fixed.

Ranjit.



_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]