improve thread suspend handling.