Chromium Code Reviews| 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..28b5c62f15246905c0327f37632811f3ae788b84 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 ReadOrFail(bool* can_read, base::subtle::Atomic32* version) const; |
|
Ken Rockot(use gerrit already)
2016/12/15 19:20:37
nitty nit: Maybe TryRead is a better name. There i
tdresser
2016/12/15 19:27:22
Done.
|
| bool ReadRetry(base::subtle::Atomic32 version) const; |
| void WriteBegin(); |
| void WriteEnd(); |