Project import generated by Copybara.

GitOrigin-RevId: bb059a0721c92e8154d33ce8057b3915a25b3d7d
This commit is contained in:
MediaPipe Team
2021-12-13 15:56:02 -08:00
committed by jqtang
parent cf101e62a9
commit e6c19885c6
96 changed files with 554 additions and 486 deletions
+4 -1
View File
@@ -161,15 +161,18 @@ void GlTextureBuffer::Reuse() {
// 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.
// Likewise, if we don't have sync fences and are simulating them, WaitOnGpu
// will also require invoking the consumer context, so we should not call it
// while holding the 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;
}
old_consumer_sync->WaitOnGpu();
}
void GlTextureBuffer::Updated(std::shared_ptr<GlSyncPoint> prod_token) {