Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: gpu/command_buffer/client/ring_buffer.cc

Issue 2550583002: gpu: Thread-safe command buffer state lookup. (Closed)
Patch Set: move cmd buffer helper memory dump to context provider Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/ring_buffer.cc
diff --git a/gpu/command_buffer/client/ring_buffer.cc b/gpu/command_buffer/client/ring_buffer.cc
index ebbb1182aed5f175f8391de22e79118cdf6f4b71..118dc57276e5d79d4810c8bcdb34561da70bb2fd 100644
--- a/gpu/command_buffer/client/ring_buffer.cc
+++ b/gpu/command_buffer/client/ring_buffer.cc
@@ -146,10 +146,9 @@ void RingBuffer::DiscardBlock(void* pointer) {
}
unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() {
- unsigned int last_token_read = helper_->last_token_read();
while (!blocks_.empty()) {
Block& block = blocks_.front();
- if (block.token > last_token_read || block.state == IN_USE) break;
+ if (!helper_->HasTokenPassed(block.token) || block.state == IN_USE) break;
jbauman 2016/12/09 03:16:03 This will most likely hit the lock at least once p
sunnyps 2016/12/09 04:09:37 I didn't expose token from the helper directly bec
FreeOldestBlock();
}
if (free_offset_ == in_use_offset_) {

Powered by Google App Engine
This is Rietveld 408576698