Skip to content

Commit 4941538

Browse files
committed
Fix typos
1 parent 5b112b8 commit 4941538

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

tests/run/lazy-impl.scala

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,6 @@
2525
*
2626
* private var _x: AnyRef = null
2727
* def x: A =
28-
* while !_x.isInstanceOf[A] do
29-
* _x match
30-
* case null =>
31-
* if CAS(_x, null, Evaluating) then
32-
* var result = rhs
33-
* // if result == null then result == NULL
34-
* if !CAS(x, Evaluating, result) then
35-
* val lock = _x.asInstanceOf[Waiting]
36-
* _x = result
37-
* lock.release(result)
38-
* // case NULL =>
39-
* // return null
40-
* case current: Waiting =>
41-
* _x = current.awaitRelease()
42-
* case _ =>
43-
* CAS(x, Evaluating, new Waiting)
44-
* // end while
45-
* current.asInstanceOf[A]
46-
*
47-
* def x: A =
4828
* _x match
4929
* case current: A =>
5030
* current
@@ -95,12 +75,12 @@
9575
* whether cache has updated
9676
* - no synchronization operations on reads after the first one
9777
* - If there is contention, we see in addition
98-
* - for the initializing thread: a volatile write and a synchronized notifyAll
78+
* - for the initializing thread: a synchronized notifyAll
9979
* - for a reading thread: 0 or 1 CAS and a synchronized wait
10080
*
10181
* Code sizes for getter:
10282
*
103-
* this scheme, if nulls are excluded in type: 72 bytes
83+
* this scheme, if nulls are excluded in type: 72 bytes
10484
* current Dotty scheme: 131 bytes
10585
* Scala 2 scheme: 39 bytes + 1 exception handler
10686
*
@@ -111,7 +91,7 @@
11191
* and normal code
11292
* - no deadlocks (other than those inherent in user code)
11393
* - synchronized code is executed only if there is contention
114-
* - simpler that current Dotty scheme
94+
* - simpler than current Dotty scheme
11595
*
11696
* Disadvantages:
11797
*

0 commit comments

Comments
 (0)