diff options
Diffstat (limited to 'sources/examples')
-rw-r--r-- | sources/examples/computeserver.scala | 2 | ||||
-rw-r--r-- | sources/examples/jolib/parallelOr.scala | 2 | ||||
-rw-r--r-- | sources/examples/pilib/rwlock.scala | 2 | ||||
-rw-r--r-- | sources/examples/pilib/semaphore.scala | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/sources/examples/computeserver.scala b/sources/examples/computeserver.scala index f86f41e3ff..acc4a0b93e 100644 --- a/sources/examples/computeserver.scala +++ b/sources/examples/computeserver.scala @@ -20,7 +20,7 @@ class ComputeServer(n: Int) { } } - def future[a](def p: a): () => a = { + def future[a](p: => a): () => a = { val reply = new SyncVar[a](); openJobs.write{ new Job { diff --git a/sources/examples/jolib/parallelOr.scala b/sources/examples/jolib/parallelOr.scala index c81de6b0e0..bff4dcd87a 100644 --- a/sources/examples/jolib/parallelOr.scala +++ b/sources/examples/jolib/parallelOr.scala @@ -35,7 +35,7 @@ object or extends Join { r.set(b) }) ); - def apply(def b1: boolean, def b2: boolean): boolean = { + def apply(b1: => boolean, b2: => boolean): boolean = { concurrent.ops.spawn(res1(res1.C(b1))); concurrent.ops.spawn(res2(res2.C(b2))); res(res.C()) diff --git a/sources/examples/pilib/rwlock.scala b/sources/examples/pilib/rwlock.scala index 3b6ba70460..0ed0f71a47 100644 --- a/sources/examples/pilib/rwlock.scala +++ b/sources/examples/pilib/rwlock.scala @@ -66,7 +66,7 @@ object rwlock { } } - def await(def cond: boolean): unit = while (false == cond) (Wait) + def await(cond: => boolean): unit = while (false == cond) (Wait) } /* diff --git a/sources/examples/pilib/semaphore.scala b/sources/examples/pilib/semaphore.scala index e41a5de024..cfb0c8e5a2 100644 --- a/sources/examples/pilib/semaphore.scala +++ b/sources/examples/pilib/semaphore.scala @@ -50,7 +50,7 @@ object semaphore { def main(args: Array[String]): unit = { val random = new java.util.Random(); val sem = new Sem2; - def mutex(def p: unit): unit = { sem.get; p; sem.release } + def mutex(p: => unit): unit = { sem.get; p; sem.release } spawn< { Thread.sleep(1 + random.nextInt(100)); |