/** A lazy cons cell, from which streams are built. */
@SerialVersionUID(-602202424901551803L)
final class Cons[+A](hd: A, tl: => Stream[A]) extends Stream[A] with Serializable {
override def isEmpty = false
override def head = hd
@volatile private[this] var tlVal: Stream[A] = _
def tailDefined: Boolean = tlVal ne null
override def tail: Stream[A] = {
if (!tailDefined)
synchronized {
if (!tailDefined) tlVal = tl
}
tlVal
}
}
通配符_
代表@volatile private[this] var tlVal: Stream[A] = _
什么?