mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Roll forward to cl/338482889
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I9850950db8bd84f0904ea1a413151887f52098cf
This commit is contained in:
@@ -3,18 +3,21 @@
|
||||
|
||||
namespace location {
|
||||
namespace nearby {
|
||||
namespace api {
|
||||
|
||||
// A boolean value that may be updated atomically.
|
||||
//
|
||||
// https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicBoolean.html
|
||||
class AtomicBoolean {
|
||||
public:
|
||||
virtual ~AtomicBoolean() {}
|
||||
virtual ~AtomicBoolean() = default;
|
||||
|
||||
virtual bool get() = 0;
|
||||
virtual void set(bool value) = 0;
|
||||
// Atomically read and return current value.
|
||||
virtual bool Get() const = 0;
|
||||
|
||||
// Atomically exchange original value with a new one. Return previous value.
|
||||
virtual bool Set(bool value) = 0;
|
||||
};
|
||||
|
||||
} // namespace api
|
||||
} // namespace nearby
|
||||
} // namespace location
|
||||
|
||||
|
||||
Reference in New Issue
Block a user