Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Serguei Spitsyn
On Mon, 6 May 2024 21:22:05 GMT, Chris Plummer wrote: >> This PR adds ranked monitor support to the debug agent. The debug agent has >> a large number of monitors, and it's really hard to know which order to grab >> them in, and for that matter which monitors might already be held at any >>

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Serguei Spitsyn
On Mon, 6 May 2024 21:22:05 GMT, Chris Plummer wrote: >> This PR adds ranked monitor support to the debug agent. The debug agent has >> a large number of monitors, and it's really hard to know which order to grab >> them in, and for that matter which monitors might already be held at any >>

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Chris Plummer
On Mon, 6 May 2024 21:22:05 GMT, Chris Plummer wrote: >> This PR adds ranked monitor support to the debug agent. The debug agent has >> a large number of monitors, and it's really hard to know which order to grab >> them in, and for that matter which monitors might already be held at any >>

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Serguei Spitsyn
On Mon, 6 May 2024 21:31:02 GMT, Chris Plummer wrote: >> I originally started at `rank`, but then when I added the 2nd of the two >> checks below I switched to 0, but your min suggestion should be optimal. > > Fixed. I was about to post a similar comment but found it has been already fixed in

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Chris Plummer
On Thu, 2 May 2024 21:02:17 GMT, Chris Plummer wrote: >> src/jdk.jdwp.agent/share/native/libjdwp/util.c line 1231: >> >>> 1229: } >>> 1230: >>> 1231: dbg_monitor->monitor = NULL; >> >> I think it would be better to protect this with dbgRawMonitor > > I don't see how that helps. Access

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Chris Plummer
On Thu, 2 May 2024 21:09:42 GMT, Chris Plummer wrote: >> src/jdk.jdwp.agent/share/native/libjdwp/util.c line 1243: >> >>> 1241: error = JVMTI_FUNC_PTR(gdata->jvmti,GetThreadInfo) >>> 1242: (gdata->jvmti, thread, ); >>> 1243: return info.name; >> >> Need to delete JNI

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Chris Plummer
On Thu, 2 May 2024 21:00:52 GMT, Chris Plummer wrote: >> src/jdk.jdwp.agent/share/native/libjdwp/util.c line 1204: >> >>> 1202: // Need to lock during initialization so verifyMonitorRank() can >>> be guaranteed that >>> 1203: // if the monitor field is set, then the monitor if fully

Re: RFR: 8328866: Add raw monitor rank support to the debug agent. [v2]

2024-05-06 Thread Chris Plummer
> This PR adds ranked monitor support to the debug agent. The debug agent has a > large number of monitors, and it's really hard to know which order to grab > them in, and for that matter which monitors might already be held at any > given moment. By imposing a rank on each monitor, we can