scala.actors.ActorProxy.scala Maven / Gradle / Ivy
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2005-2007, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id: ActorProxy.scala 10121 2007-02-27 13:18:00Z phaller $
package scala.actors
import java.lang.Thread
/**
* The class ActorProxy
provides a dynamic actor proxy for normal
* Java threads.
*
* @version 0.9.4
* @author Philipp Haller
*/
private[actors] class ActorProxy(t: Thread) extends Actor {
def act() {}
/**
*
* Terminates execution of self
with the following
* effect on linked actors:
*
*
* For each linked actor a
with
* trapExit
set to true
, send message
* {'EXIT, self, reason}
to a
.
*
*
* For each linked actor a
with
* trapExit
set to false
(default),
* call a.exit(reason)
if
* reason != 'normal
.
*
*
* @param reason the exit reason of the interrupted thread.
*/
override def exit(reason: AnyRef): Nothing = {
kill()
// links
if (!links.isEmpty) {
exitReason = reason
exitLinked()
}
throw new InterruptedException
}
}