diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/testblock.scala | 33 | ||||
-rw-r--r-- | test/files/run/testpar.scala | 24 |
2 files changed, 0 insertions, 57 deletions
diff --git a/test/files/run/testblock.scala b/test/files/run/testblock.scala deleted file mode 100644 index a334b668fd..0000000000 --- a/test/files/run/testblock.scala +++ /dev/null @@ -1,33 +0,0 @@ - - - - -import scala.parallel._ - - - - -object Test { - - def main(args: Array[String]) { - if (util.Properties.isJavaAtLeast("1.6")) { - val vendor = util.Properties.javaVmVendor - if ((vendor contains "Sun") || (vendor contains "Apple")) blockcomp(10) - } - } - - val lock = new java.util.concurrent.locks.ReentrantLock - - def blockcomp(n: Int): Unit = if (n > 0) { - val (x, y) = par(blockcomp(n - 1), blockcomp(n - 1)) - if (n == 8) blocking { // without this blocking block, deadlock occurs - lock.lock() - } - x() - y() - if (n == 8) { - lock.unlock() - } - } - -} diff --git a/test/files/run/testpar.scala b/test/files/run/testpar.scala deleted file mode 100644 index c4c813ee00..0000000000 --- a/test/files/run/testpar.scala +++ /dev/null @@ -1,24 +0,0 @@ - - - -import scala.parallel._ - - - - - -object Test { - - def main(args: Array[String]) { - if (util.Properties.isJavaAtLeast("1.6")) { - val vendor = util.Properties.javaVmVendor - if ((vendor contains "Sun") || (vendor contains "Apple")) assert(fib(40) == 102334155) - } - } - - def fib(n: Int): Int = if (n < 3) 1 else if (n < 35) fib(n - 1) + fib(n - 2) else { - val (p, pp) = par(fib(n - 1), fib(n - 2)) - p() + pp() - } - -} |