X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=promise.cc;h=3a38384721cd3dfdc59b25f59440b432cf62c87b;hp=df86090a2335ff3e17c69d33a98c9d370903f199;hb=981465809f7f1fdf2693daf099be5e5f75967ed8;hpb=144f1b806679fd9030147f554513d7fce36f65dc diff --git a/promise.cc b/promise.cc index df86090..3a38384 100644 --- a/promise.cc +++ b/promise.cc @@ -100,6 +100,19 @@ bool Promise::thread_is_available(thread_id_t tid) const return available_thread[id]; } +/** + * @brief Get an upper bound on the number of available threads + * + * Gets an upper bound on the number of threads in the available threads set, + * useful for iterating over "thread_is_available()". + * + * @return The upper bound + */ +unsigned int Promise::max_available_thread_idx() const +{ + return available_thread.size(); +} + /** @brief Print debug info about the Promise */ void Promise::print() const {