mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
A little more cleanup.
This commit is contained in:
parent
f3dfd63634
commit
e74cd4b4ef
1 changed files with 5 additions and 6 deletions
|
@ -28,7 +28,6 @@
|
||||||
#define ZT_ATOMICCOUNTER_HPP
|
#define ZT_ATOMICCOUNTER_HPP
|
||||||
|
|
||||||
#include "Constants.hpp"
|
#include "Constants.hpp"
|
||||||
#include "NonCopyable.hpp"
|
|
||||||
|
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
@ -39,13 +38,10 @@ namespace ZeroTier {
|
||||||
/**
|
/**
|
||||||
* Simple atomic counter supporting increment and decrement
|
* Simple atomic counter supporting increment and decrement
|
||||||
*/
|
*/
|
||||||
class AtomicCounter : NonCopyable
|
class AtomicCounter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AtomicCounter()
|
AtomicCounter() { _v = 0; }
|
||||||
{
|
|
||||||
_v = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int load() const
|
inline int load() const
|
||||||
{
|
{
|
||||||
|
@ -75,6 +71,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
AtomicCounter(const AtomicCounter &) {}
|
||||||
|
const AtomicCounter &operator=(const AtomicCounter &) { return *this; }
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
int _v;
|
int _v;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue