forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerfCounter.cpp
More file actions
36 lines (35 loc) · 1.04 KB
/
PerfCounter.cpp
File metadata and controls
36 lines (35 loc) · 1.04 KB
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#include "CommonCorePch.h"
#include "PerfCounterImpl.cpp"
#ifdef PERF_COUNTERS
namespace PerfCounter
{
Counter& Counter::operator+=(size_t value)
{
Assert(count);
::InterlockedExchangeAdd(count, (DWORD)value);
return *this;
}
Counter& Counter::operator-=(size_t value)
{
Assert(count);
::InterlockedExchangeSubtract(count, (DWORD)value);
return *this;
}
Counter& Counter::operator++()
{
Assert(count);
::InterlockedIncrement(count);
return *this;
}
Counter& Counter::operator--()
{
Assert(count);
::InterlockedDecrement(count);
return *this;
}
}
#endif