X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=promise.cc;h=3a38384721cd3dfdc59b25f59440b432cf62c87b;hb=130a35155171503883aaf18e57f8957ce63d06e8;hp=df86090a2335ff3e17c69d33a98c9d370903f199;hpb=9d9b9121ffed4c7406275da34b055040ea5090a9;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 {