aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/poco/Foundation/src/AtomicCounter.cpp
blob: 32a4ef6a00ed996ff0c13e6162dbc17efbdc644f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// AtomicCounter.cpp
//
// Library: Foundation
// Package: Core
// Module:  AtomicCounter
//
// Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier:	BSL-1.0
//


#include "Poco/AtomicCounter.h"


namespace Poco {


AtomicCounter::AtomicCounter():
	_counter(0)
{
}


AtomicCounter::AtomicCounter(AtomicCounter::ValueType initialValue):
	_counter(initialValue)
{
}


AtomicCounter::AtomicCounter(const AtomicCounter& counter):
	_counter(counter.value())
{
}


AtomicCounter::~AtomicCounter()
{
}


AtomicCounter& AtomicCounter::operator = (const AtomicCounter& counter)
{
	_counter.store(counter._counter.load());
	return *this;
}


AtomicCounter& AtomicCounter::operator = (AtomicCounter::ValueType value)
{
	_counter.store(value);
	return *this;
}


} // namespace Poco