Yea, but the signal can't invoke in this thread because there is no event queue in this thread and this code isn't thread safe.