Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.concurrent/SyncVar

SyncVar

scala.concurrent.SyncVar
classSyncVar[A]

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.
Source
SyncVar.scala
Graph
Supertypes
classObject
traitMatchable
classAny

Members list

Value members

Concrete methods

defget:A

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

Source
SyncVar.scala
defget(timeout:Long):Option[A]

Wait at leasttimeout milliseconds (possibly more) for thisSyncVar to become defined and then get its value.

Wait at leasttimeout milliseconds (possibly more) for thisSyncVar to become defined and then get its value.

Value parameters

timeout

time in milliseconds to wait

Attributes

Returns

None if variable is undefined aftertimeout,Some(value) otherwise

Source
SyncVar.scala

Check whether a value is stored in the synchronized variable.

Check whether a value is stored in the synchronized variable.

Attributes

Source
SyncVar.scala
defput(x:A):Unit

Place a value in the SyncVar.

Place a value in the SyncVar. If the SyncVar already has a stored value, wait until another thread takes it.

Attributes

Source
SyncVar.scala
deftake():A

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

Source
SyncVar.scala
deftake(timeout:Long):A

Wait at leasttimeout milliseconds (possibly more) for thisSyncVar to become defined and then get the stored value, unsetting it as a side effect.

Wait at leasttimeout milliseconds (possibly more) for thisSyncVar 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
Source
SyncVar.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp