Edit to thread_avail using map access