[threading] Reorganize code to work with the coop backend.