Changed receive to use proper pthread signals.