add source_signal inspired by libevent.
add its test case.