Changeset 6078

Show
Ignore:
Timestamp:
02/03/08 03:19:49 (7 years ago)
Author:
keisuken
Message:

Add method of Thread library.

Location:
lang/scala/sandbox
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/lang/Thread.scala

    r6076 r6078  
    1313  } 
    1414 
    15   def sleep(t: Long): Unit = Thread.sleep(t) 
     15 
     16  def activeCount = java.lang.Thread.activeCount() 
     17 
     18  def current = java.lang.Thread.currentThread() 
     19  def currentThread = current 
     20 
     21  def dump = java.lang.Thread.dumpStack() 
     22  def dumpStack = dump 
     23 
     24  def holdsLock(obj: AnyRef) = java.lang.Thread.holdsLock(obj) 
     25 
     26  def interrupted = java.lang.Thread.interrupted() 
     27 
     28  def defaultUncaughtExceptionHandler( 
     29    handler: java.lang.Thread.UncaughtExceptionHandler) = 
     30      java.lang.Thread.setDefaultUncaughtExceptionHandler(handler) 
     31 
     32  def sleep(millis: Long): Unit = java.lang.Thread.sleep(millis) 
     33  def sleep(millis: Long, nanos: Int): Unit = 
     34    java.lang.Thread.sleep(millis, nanos) 
     35 
     36//  def _yield = java.lang.Thread.yield() 
    1637} 
  • lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/lang/ThreadTest.scala

    r6076 r6078  
    88      for(i <- 1 to 10) { 
    99        println(i) 
    10         sleep(1000L) 
     10        sleep(1000) 
    1111      } 
    1212    }