X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=promise.cc;h=3a38384721cd3dfdc59b25f59440b432cf62c87b;hb=6070a45c81428a5e09909d4beb325150aefd0c52;hp=df86090a2335ff3e17c69d33a98c9d370903f199;hpb=c2b7fc251420c50f51bf9c7f07f37d82b2bfc068;p=model-checker.git 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 {