diff options
author | mihaylov <mihaylov@epfl.ch> | 2005-08-26 15:17:13 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2005-08-26 15:17:13 +0000 |
commit | 7d50bd127a071b84cc3d5e6e989b5f57d5988aaf (patch) | |
tree | 4150782d52b5f6a541eed6b9b91dad0c0a93b82b /sources/examples/pilib | |
parent | bc6f997f0a06bf2c8b2e05d34623474a7f91a986 (diff) | |
download | scala-7d50bd127a071b84cc3d5e6e989b5f57d5988aaf.tar.gz scala-7d50bd127a071b84cc3d5e6e989b5f57d5988aaf.tar.bz2 scala-7d50bd127a071b84cc3d5e6e989b5f57d5988aaf.zip |
Use the new syntax for def parameters
Diffstat (limited to 'sources/examples/pilib')
-rw-r--r-- | sources/examples/pilib/rwlock.scala | 2 | ||||
-rw-r--r-- | sources/examples/pilib/semaphore.scala | 2 |
2 files changed, 2 insertions, 2 deletions
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)); |