Package jnr.constants.platform

Examples of jnr.constants.platform.Signal


    public SignalWrap(NodeProcess process) {
        super(process, true);
    }

    public void start(int signum) {
        Signal signal = Signal.valueOf( signum );
        this.process.getPosix().signal( signal, this );
    }
View Full Code Here


        }
    }
   
    @Test
    public void testBasicSignal() {
        Signal s = Signal.SIGHUP;
        final AtomicBoolean fired = new AtomicBoolean(false);
        posix.signal(s, new SignalHandler() {
            public void handle(int signal) {
                fired.set(true);
            }
        });
       
        posix.kill(posix.getpid(), s.intValue());
        waitUntilTrue(fired, 200);
        Assert.assertTrue(fired.get());
    }
View Full Code Here

        Assert.assertTrue(fired.get());
    }
   
    @Test
    public void testJavaSignal() {
        Signal s = Signal.SIGHUP;
        final AtomicBoolean fired = new AtomicBoolean(false);
        javaPosix.signal(s, new SignalHandler() {
            public void handle(int signal) {
                fired.set(true);
            }
        });
       
        // have to use native here; no abstraction for kill in pure Java
        // TODO: sun.misc.Signal.raise can be used to kill current pid
        posix.kill(posix.getpid(), s.intValue());

        waitUntilTrue(fired, 200);
        Assert.assertTrue(fired.get());
    }
View Full Code Here

TOP

Related Classes of jnr.constants.platform.Signal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.