diff options
Diffstat (limited to 'cc/resources/resource_pool.cc')
-rw-r--r-- | cc/resources/resource_pool.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc index bb22b79..23a6233 100644 --- a/cc/resources/resource_pool.cc +++ b/cc/resources/resource_pool.cc @@ -187,12 +187,15 @@ void ResourcePool::DeleteResource(ScopedResource* resource) { delete resource; } -void ResourcePool::CheckBusyResources() { +void ResourcePool::CheckBusyResources(bool wait_if_needed) { ResourceList::iterator it = busy_resources_.begin(); while (it != busy_resources_.end()) { ScopedResource* resource = it->resource; + if (wait_if_needed) + resource_provider_->WaitReadLockIfNeeded(resource->id()); + if (resource_provider_->CanLockForWrite(resource->id())) { DidFinishUsingResource(resource, it->content_id); it = busy_resources_.erase(it); |