def does_stuff(): rsignal.pypysig_setflag(signal.SIGUSR1) os.kill(os.getpid(), signal.SIGUSR1) rsignal.pypysig_ignore(signal.SIGUSR1) while True: n = rsignal.pypysig_poll() if n < 0 or n == signal.SIGUSR1: break return n
def does_stuff(): os.setpgid(0, 0) # become its own separated process group rsignal.pypysig_setflag(signal.SIGUSR1) os.killpg(os.getpgrp(), signal.SIGUSR1) rsignal.pypysig_ignore(signal.SIGUSR1) while True: n = rsignal.pypysig_poll() if n < 0 or n == signal.SIGUSR1: break return n
def check_sigusr(self, s_frame): poll = rsignal.pypysig_poll() if poll == rsignal.SIGUSR1: print s_frame.print_stack()
def check(expected): res = rsignal.pypysig_poll() os.write(1, "poll() => %d, expected %d\n" % (res, expected)) assert res == expected