src/runtime/threads/resource_manager.cpp
std::size_t resource_manager::reserve_processing_units(
        std::size_t use_count, std::size_t desired,
        std::vector<punit_status>& available_punits)
    {
        std::size_t available = 0;
        for (std::size_t i = 0; i != punits_.size(); ++i)
        {
            if (use_count == punits_[i].use_count_)
            {
                available_punits[i] = punit_status::reserved;
                if (++available == desired)
                    break;
            }
        }
        return available;
    }
// Find 'desired' amount of processing units which have the given use count
// (use count is the number of schedulers associated with a given processing
// unit).
//
// the resource manager is locked while executing this function
Find 'desired' amount of processing units which have the given use count
(use count is the number of schedulers associated with a given processing
unit).

the resource manager is locked while executing this function
Find ' desired ' amount of processing units which have the given use count ( use count is the number of schedulers associated with a given processing unit ) . the resource manager is locked while executing this function
std::size_t resource_manager::reserve_processing_units(
        std::size_t use_count, std::size_t desired,
        std::vector<punit_status>& available_punits)
    {
        std::size_t available = 0;
        for (std::size_t i = 0; i != punits_.size(); ++i)
        {
            if (use_count == punits_[i].use_count_)
            {
                available_punits[i] = punit_status::reserved;
                if (++available == desired)
                    break;
            }
        }
        return available;
    }
std :: size_t resource_manager :: reserve_processing_units ( std :: size_t use_count , std :: size_t desired , std :: vector < punit_status > & available_punits ) { std :: size_t available = 0 ; for ( std :: size_t i = 0 ; i != punits_ . size ( ) ; ++ i ) { if ( use_count == punits_ [ i ] . use_count_ ) { available_punits [ i ] = punit_status :: reserved ; if ( ++ available == desired ) break ; } } return available ; }
Find 'desired' amount of processing units which have the given use count
(use count is the number of schedulers associated with a given processing
unit).
Find ' desired ' amount of processing units which have the given use count ( use count is the number of schedulers associated with a given processing unit ) .