diff --git a/kern/exception.c b/kern/exception.c
index 6cb3bfb..c68c5cb 100644
--- a/kern/exception.c
+++ b/kern/exception.c
@@ -875,12 +875,10 @@ exception_raise_continue_slow(
 		 *	and then resume the receive.
 		 */
 
-		while (thread_should_halt(self)) {
-			/* don't terminate while holding a reference */
-			if (self->ast & AST_TERMINATE)
-				ipc_port_release(reply_port);
+		if (thread_should_halt(self))
+			ipc_port_release(reply_port);
+		while (thread_should_halt(self))
 			thread_halt_self();
-		}
 
 		ip_lock(reply_port);
 		if (!ip_active(reply_port)) {
