Skip to main content

MonitorKind

Enum MonitorKind 

Source
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. BlockedAcquired brackets one contended entry (a thread queued on a lock somebody else held, then got it), and WaitWaited 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

Source

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.

Source

pub const fn event_kind(self) -> u8

The JDWP event kind this registers as, used for both Set and Clear.

Source

pub const fn label(self) -> &'static str

Lowercase label used in tool arguments and output.

Source

pub const fn partner(self) -> Self

The other half of this kind’s pair — the one an elapsed measurement needs armed as well.

Source

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

Source§

fn clone(&self) -> MonitorKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MonitorKind

Source§

impl Debug for MonitorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MonitorKind

Source§

impl PartialEq for MonitorKind

Source§

fn eq(&self, other: &MonitorKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MonitorKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more