Project import generated by Copybara.

GitOrigin-RevId: afeb9cf5a8c069c0a566d16e1622bbb086170e4d
This commit is contained in:
MediaPipe Team
2020-05-21 13:37:51 -04:00
committed by chuoling
parent b6e680647c
commit b133b0f200
258 changed files with 4146 additions and 5147 deletions
+13 -5
View File
@@ -87,11 +87,19 @@ bool GlTextureBuffer::CreateInternal(const void* data) {
}
void GlTextureBuffer::Reuse() {
absl::MutexLock lock(&consumer_sync_mutex_);
consumer_multi_sync_->WaitOnGpu();
// Reset the sync points.
consumer_multi_sync_ = absl::make_unique<GlMultiSyncPoint>();
producer_sync_ = nullptr;
// The old consumer sync destructor may call other contexts to delete their
// sync fences; with a single-threaded executor, that means switching to
// each of those contexts, grabbing its mutex. Let's do that after releasing
// our own mutex.
std::unique_ptr<GlMultiSyncPoint> old_consumer_sync;
{
absl::MutexLock lock(&consumer_sync_mutex_);
consumer_multi_sync_->WaitOnGpu();
// Reset the sync points.
old_consumer_sync = std::move(consumer_multi_sync_);
consumer_multi_sync_ = absl::make_unique<GlMultiSyncPoint>();
producer_sync_ = nullptr;
}
}
void GlTextureBuffer::Updated(std::shared_ptr<GlSyncPoint> prod_token) {