deadlock fix: reset the flag *after* checking the blackhole queue