    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class com.darwinsys.signal.LibSignal

    java.lang.Object
       |
       +----com.darwinsys.signal.LibSignal

public class LibSignal
extends Object

This is Ian Darwin's signal handler for Java JDK 1.1. COMPLETELY UNSUPPORTED; USE AT OWN RISK. TEST EARLY AND OFTEN. The general plan is:

- your main constructs a Thread subclass, but doesn't start it.
- pass a ref to it into the routine sigHandler.
- SigHandler arranges to catch signals and, when any signal is caught, it calls your Thread.start()

N.B. We DO NOT KNOW if most jvm's are signal safe! We hope that calling it in the context of the running thread is OK. It works for the cases we've tested.

This way, we aren't trying to do anything too fancy like create a thread from withing the signal handler; it has only to call start.

##

LibSignal()

##

setsighandler(Thread)
setSignalHandler(Thread)

##

LibSignal

     public LibSignal()

##

setsighandler

     public static native void setsighandler(Thread r)

setSignalHandler

     public static void setSignalHandler(Thread r)

    All Packages  Class Hierarchy  This Package  Previous  Next  Index