signal assert if not mainthread