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

Unified Diff: device/base/synchronization/one_writer_seqlock.h

Issue 2273703002: Force events to be non blocking if main thread is unresponsive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Histogram nits 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
« no previous file with comments | « content/renderer/render_widget_unittest.cc ('k') | device/base/synchronization/one_writer_seqlock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/base/synchronization/one_writer_seqlock.h
diff --git a/device/base/synchronization/one_writer_seqlock.h b/device/base/synchronization/one_writer_seqlock.h
index 29db0f1bcdfea4222a1cc9b52dfa46f4795d5e6d..7be840560156c3cd7e46e1a7d809a9a4d899b467 100644
--- a/device/base/synchronization/one_writer_seqlock.h
+++ b/device/base/synchronization/one_writer_seqlock.h
@@ -18,8 +18,8 @@ namespace device {
// http://www.concurrencykit.org/doc/ck_sequence.html
// This implementation is based on ck_sequence.h from http://concurrencykit.org.
//
-// Currently this type of lock is used in two implementations (gamepad and
-// device motion, in particular see e.g. shared_memory_seqlock_buffer.h).
+// Currently this type of lock is used in at least two implementations (gamepad
+// and device motion, in particular see e.g. shared_memory_seqlock_buffer.h).
// It may make sense to generalize this lock to multiple writers.
//
// You must be very careful not to operate on potentially inconsistent read
@@ -32,6 +32,7 @@ class OneWriterSeqLock {
public:
OneWriterSeqLock();
base::subtle::Atomic32 ReadBegin() const;
+ void TryRead(bool* can_read, base::subtle::Atomic32* version) const;
bool ReadRetry(base::subtle::Atomic32 version) const;
void WriteBegin();
void WriteEnd();
« no previous file with comments | « content/renderer/render_widget_unittest.cc ('k') | device/base/synchronization/one_writer_seqlock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698