begin
or tryBegin
methods at the start
of a block, and the end
method at the end of a block.
Modifier and Type | Class and Description |
---|---|
private static record | ThreadTracker.
A reference to a Thread that is suitable for use as a key in a collection. |
Modifier and Type | Field and Description |
---|---|
private final Set |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public Object | |
public boolean | |
public void | |
public Object |
threads | back to summary |
---|---|
private final Set<ThreadTracker. |
ThreadTracker | back to summary |
---|---|
public ThreadTracker() |
begin | back to summary |
---|---|
public Object begin() Adds the current thread to thread set if not already in the set. Returns a key to remove the thread. |
contains | back to summary |
---|---|
public boolean contains(Thread thread) Returns true if the given thread is tracked. |
end | back to summary |
---|---|
public void end(Object key) Removes the thread identified by the key from the thread set. |
tryBegin | back to summary |
---|---|
public Object tryBegin() Adds the current thread to thread set if not already in the set.
Returns a key to remove the thread or |
Modifier and Type | Field and Description |
---|---|
private final Thread |
Modifier and Type | Method and Description |
---|---|
public boolean | equals(Object
the reference object with which to compare. obj)Implements abstract java. Indicates whether some other object is "equal to" this one. |
public int | |
public Thread | |
public final String | toString()
Implements abstract java. Returns a string representation of the record. |
thread | back to summary |
---|---|
private final Thread thread Record Component accessed by thread(). |
ThreadRef | back to summary |
---|---|
private ThreadRef(Thread thread) |
equals | back to summary |
---|---|
public boolean equals(Object obj) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of R copy = new R(r.c1(), r.c2(), ..., r.cn());then it must be the case that r.equals(copy) .
|
hashCode | back to summary |
---|---|
public int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
|
thread | back to summary |
---|---|
public Thread thread() Record Component getter of thread. |
toString | back to summary |
---|---|
public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
|