fix raise semantics with threads.