Skip to content

Commit ae319fa

Browse files
committed
Remove extra notify call, and parentheses.
1 parent c1125ad commit ae319fa

File tree

1 file changed

+2
-3
lines changed
  • src/main/scala/org/learningconcurrency/exercises/ch2

1 file changed

+2
-3
lines changed

src/main/scala/org/learningconcurrency/exercises/ch2/ex6.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ object Ex6 extends App {
1313

1414
def getWait():T = this.synchronized {
1515
while (syncQueue.isEmpty) {
16-
this.notify
17-
this.wait
16+
this.wait()
1817
}
1918

2019
val x = syncQueue.dequeue
@@ -47,7 +46,7 @@ object Ex6 extends App {
4746
val consumer = thread {
4847
var x = -1
4948
while(x < 14) {
50-
x = syncVar.getWait
49+
x = syncVar.getWait()
5150
log(s"get: $x")
5251
}
5352
}

0 commit comments

Comments
 (0)