pub enum MonitorKind {
Blocked,
Acquired,
Wait,
Waited,
}Expand description
Which of the four monitor events a request fires on (DUMP-7, #96).
They are two pairs, not four independent kinds, and the names say which. Blocked → Acquired
brackets one contended entry (a thread queued on a lock somebody else held, then got it), and Wait
→ Waited brackets one Object.wait(). Arming only one half of a pair is legitimate — it answers “is
anything blocking at all” for the price of one request — but it can never yield a duration, because
neither half carries a
timing and the elapsed is measured across the two.
The labels are deliberately not the JDWP constant names. MONITOR_CONTENDED_ENTER and
MONITOR_CONTENDED_ENTERED differ by two letters and mean opposite ends of the same block, which is a
reading mistake waiting to happen in a reply a human has to act on.
Variants§
Blocked
MONITOR_CONTENDED_ENTER (43): a thread began blocking on a monitor another thread owns.
Acquired
MONITOR_CONTENDED_ENTERED (44): a thread that was blocking has acquired the monitor.
Wait
MONITOR_WAIT (45): a thread is about to Object.wait(), which releases the monitor.
Waited
MONITOR_WAITED (46): a thread’s Object.wait() returned, either notified or timed out.
Implementations§
Source§impl MonitorKind
impl MonitorKind
Sourcepub const ALL: [Self; 4]
pub const ALL: [Self; 4]
Every kind, in the order the protocol numbers them — so a caller arming “all of them” arms them in a stable, reportable order rather than a hash order.
Sourcepub const fn event_kind(self) -> u8
pub const fn event_kind(self) -> u8
The JDWP event kind this registers as, used for both Set and Clear.
Sourcepub const fn partner(self) -> Self
pub const fn partner(self) -> Self
The other half of this kind’s pair — the one an elapsed measurement needs armed as well.
Sourcepub const fn class_filter_tests_monitor(self) -> bool
pub const fn class_filter_tests_monitor(self) -> bool
Whether a ClassOnly modifier on this kind tests the monitor object’s class rather than the
location’s — true for the wait pair only, per mod_kinds::CLASS_ONLY.
Trait Implementations§
Source§impl Clone for MonitorKind
impl Clone for MonitorKind
Source§fn clone(&self) -> MonitorKind
fn clone(&self) -> MonitorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more