- /* When no more threads, or when execution replay chooses the
- * 'model_thread': launch end-of-execution release sequence fixups */
- if (!pending_rel_seqs->empty() && (!next || next->is_model_thread())) {
+ /*
+ * Launch end-of-execution release sequence fixups only when there are:
+ *
+ * (1) no more user threads to run (or when execution replay chooses
+ * the 'model_thread')
+ * (2) pending release sequences
+ * (3) pending assertions (i.e., data races)
+ * (4) no pending promises
+ */
+ if (!pending_rel_seqs->empty() && (!next || next->is_model_thread()) &&
+ isfinalfeasible() && !unrealizedraces.empty()) {