diff options
author | Darius Makovsky <traveltissues@protonmail.com> | 2019-12-05 16:18:05 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-12-09 08:08:31 +0000 |
commit | 8c63b96400e290e23478acbc17d45b662fa7a208 (patch) | |
tree | 2fe9b82c9acc8ac234e78eeee7704a30ad10b1a3 | |
parent | fdab45358a79a5bc0248bbb88429e9a6328371f9 (diff) | |
download | buildstream-8c63b96400e290e23478acbc17d45b662fa7a208.tar.gz |
resources: remove [un]register_exclusive_interest()
-rw-r--r-- | src/buildstream/_scheduler/resources.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/buildstream/_scheduler/resources.py b/src/buildstream/_scheduler/resources.py index e76158779..a11555c53 100644 --- a/src/buildstream/_scheduler/resources.py +++ b/src/buildstream/_scheduler/resources.py @@ -113,53 +113,3 @@ class Resources: for resource in resources: assert self._used_resources[resource] > 0, "Scheduler resource imbalance" self._used_resources[resource] -= 1 - - # register_exclusive_interest() - # - # Inform the resources pool that `source` has an interest in - # reserving this resource exclusively. - # - # The source parameter is used to identify the caller, it - # must be ensured to be unique for the time that the - # interest is registered. - # - # This function may be called multiple times, and subsequent - # calls will simply have no effect until clear_exclusive_interest() - # is used to clear the interest. - # - # This must be called in advance of reserve() - # - # Args: - # resources (set): Set of resources to reserve exclusively - # source (any): Source identifier, to be used again when unregistering - # the interest. - # - def register_exclusive_interest(self, resources, source): - - # The very first thing we do is to register any exclusive - # resources this job may want. Even if the job is not yet - # allowed to run (because another job is holding the resource - # it wants), we can still set this - it just means that any - # job *currently* using these resources has to finish first, - # and no new jobs wanting these can be launched (except other - # exclusive-access jobs). - # - for resource in resources: - self._exclusive_resources[resource].add(source) - - # unregister_exclusive_interest() - # - # Clear the exclusive interest in these resources. - # - # This should be called by the given source which registered - # an exclusive interest. - # - # Args: - # resources (set): Set of resources to reserve exclusively - # source (str): Source identifier, to be used again when unregistering - # the interest. - # - def unregister_exclusive_interest(self, resources, source): - - for resource in resources: - self._exclusive_resources[resource].discard(source) |