mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Internal change
PiperOrigin-RevId: 380085191
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
#ifndef PLATFORM_IMPL_WINDOWS_ATOMIC_BOOLEAN_H_
|
||||
#define PLATFORM_IMPL_WINDOWS_ATOMIC_BOOLEAN_H_
|
||||
|
||||
#include "platform/api/atomic_boolean.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
#include "platform/api/atomic_boolean.h"
|
||||
|
||||
namespace location {
|
||||
namespace nearby {
|
||||
namespace windows {
|
||||
@@ -26,24 +26,15 @@ namespace windows {
|
||||
// A boolean value that may be updated atomically.
|
||||
class AtomicBoolean : public api::AtomicBoolean {
|
||||
public:
|
||||
// TODO(b/184975123): replace with real implementation.
|
||||
~AtomicBoolean() override = default;
|
||||
|
||||
// Atomically read and return current value.
|
||||
bool Get() const override {
|
||||
// TODO(b/184975123): replace with real implementation.
|
||||
return atomic_boolean_;
|
||||
};
|
||||
|
||||
// Atomically exchange original value with a new one. Return previous value.
|
||||
bool Set(bool value) override {
|
||||
// TODO(b/184975123): replace with real implementation.
|
||||
bool original = atomic_boolean_;
|
||||
|
||||
atomic_boolean_ = value;
|
||||
|
||||
return original;
|
||||
};
|
||||
bool Set(bool value) override { return atomic_boolean_.exchange(value); };
|
||||
|
||||
private:
|
||||
std::atomic_bool atomic_boolean_;
|
||||
|
||||
@@ -26,15 +26,12 @@ namespace windows {
|
||||
// Type that allows 32-bit atomic reads and writes.
|
||||
class AtomicUint32 : public api::AtomicUint32 {
|
||||
public:
|
||||
// TODO(b/184975123): replace with real implementation.
|
||||
~AtomicUint32() override = default;
|
||||
|
||||
// Atomically reads and returns stored value.
|
||||
// TODO(b/184975123): replace with real implementation.
|
||||
std::uint32_t Get() const override { return atomic_uint32_; };
|
||||
|
||||
// Atomically stores value.
|
||||
// TODO(b/184975123): replace with real implementation.
|
||||
void Set(std::uint32_t value) override { atomic_uint32_ = value; }
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user