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

Unified Diff: content/common/gpu/sync_point_manager.cc

Issue 279303003: Randomize sync point starting number to reduce risk of GPU hangs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/sync_point_manager.cc
diff --git a/content/common/gpu/sync_point_manager.cc b/content/common/gpu/sync_point_manager.cc
index 0e84e1cb99d41fb111f65c2a2bd50891291a1572..9383574faf9eb1039d8111f0b8ff46389425335f 100644
--- a/content/common/gpu/sync_point_manager.cc
+++ b/content/common/gpu/sync_point_manager.cc
@@ -4,12 +4,20 @@
#include "content/common/gpu/sync_point_manager.h"
+#include <climits>
+
#include "base/logging.h"
+#include "base/rand_util.h"
namespace content {
+static const int kMaxSyncBase = INT_MAX;
+
SyncPointManager::SyncPointManager()
- : next_sync_point_(1) {
+ : next_sync_point_(base::RandInt(1, kMaxSyncBase)) {
+ // To reduce the risk that a sync point created in a previous GPU process
+ // will be in flight in the next GPU process, randomize the starting sync
+ // point number. http://crbug.com/373452
}
SyncPointManager::~SyncPointManager() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698