Convert ERR_STATE to new multi-threading API