detect and report a case of deadlock

This commit is contained in:
Matthew Flatt 2010-12-28 11:09:38 -07:00
parent 8ac21c745f
commit 3e3ed33cbf
2 changed files with 9 additions and 8 deletions

View File

@ -657,15 +657,11 @@ int scheme_wait_semas_chs(int n, Scheme_Object **o, int just_try, Syncing *synci
}
if (ii >= n) {
if (!scheme_current_thread->next)
if (!scheme_wait_until_suspend_ok()) {
break;
else {
if (!scheme_wait_until_suspend_ok()) {
break;
} else {
/* there may have been some action on one of the waitables;
try again */
}
} else {
/* there may have been some action on one of the waitables;
try again */
}
} else
break;

View File

@ -4641,6 +4641,11 @@ int scheme_wait_until_suspend_ok(void)
--atomic_timeout_auto_suspend;
}
if (do_atomic) {
scheme_log_abort("about to suspend in atomic mode");
abort();
}
return did;
}