SyncVar
A class to provide safe concurrent access to a mutable cell. All methods are synchronized.
Type parameters
- A
-
type of the contained value
Attributes
- Deprecated
-
[Since version 2.13.0]Use `java.util.concurrent.LinkedBlockingQueue with capacity 1` instead. - Graph
-
- Supertypes
Members list
Value members
Concrete methods
Wait for this SyncVar to become defined and then get the stored value without modifying it.
Wait for this SyncVar to become defined and then get the stored value without modifying it.
Attributes
- Returns
-
value that is held in this container
Wait at least timeout milliseconds (possibly more) for this SyncVar to become defined and then get its value.
Wait at least timeout milliseconds (possibly more) for this SyncVar to become defined and then get its value.
Value parameters
- timeout
-
time in milliseconds to wait
Attributes
- Returns
-
Noneif variable is undefined aftertimeout,Some(value)otherwise
Check whether a value is stored in the synchronized variable.
Check whether a value is stored in the synchronized variable.
Attributes
Place a value in the SyncVar. If the SyncVar already has a stored value, wait until another thread takes it.
Place a value in the SyncVar. If the SyncVar already has a stored value, wait until another thread takes it.
Attributes
Wait for this SyncVar to become defined and then get the stored value, unsetting it as a side effect.
Wait for this SyncVar to become defined and then get the stored value, unsetting it as a side effect.
Attributes
- Returns
-
value that was held in this container
Wait at least timeout milliseconds (possibly more) for this SyncVar to become defined and then get the stored value, unsetting it as a side effect.
Wait at least timeout milliseconds (possibly more) for this SyncVar to become defined and then get the stored value, unsetting it as a side effect.
Value parameters
- timeout
-
the amount of milliseconds to wait
Attributes
- Returns
-
the value or a throws an exception if the timeout occurs
- Throws
-
NoSuchElementException
on timeout