JDK-6282335 : DetachCurrentThread doesn't release monitors was taken by MonitorEnter (doc change)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2005-06-08
  • Updated: 2017-05-16
  • Resolved: 2005-12-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 betaFixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
JNI spec states that all Java monitors held by thread are released after call of DetachCurrentThread. Test (see attachment) shows that it isn't correct.

PS Wow, but jrockit works fine.
###@###.### 2005-06-08 13:00:11 GMT

DetachCurrentThread also doesn't free local variables from java frames in thread stack. These frames are unreacheable but GC doesn't collect them until native thread is finished.
###@###.### 2005-06-09 14:51:06 GMT

I'm sorry, i had attached incorrect test case sources. Updated source is correct (no DetachCurrentThread failures).
Moreover, IBM VM have the same problem as a hotspot. but jrockit still correct one!
###@###.### 2005-06-22 13:30:51 GMT

Comments
EVALUATION The new bug is 6336479.
13-10-2005

EVALUATION This bug will be treated as the doc bug to clarify that DetachCurrentThread should not be called with Java frames on the stack. Lowering the priority accordingly. A new bug will be filed for the Detach issue so that a separate CCC request can be filed along with it.
12-10-2005

EVALUATION With the new testcase I can see the problem. With no Java frames on the stack, DetachCurrentThread indeed does not release JNI-acquired monitors held by the thread. ###@###.### 2005-06-23 20:14:13 GMT
23-06-2005