Merge "Add functions to query #threads and looper state."