hydra/src/hydra-queue-runner/counter.hh
Eelco Dolstra c6fcce3b3b Moar stats
2015-06-25 16:47:39 +02:00

13 lines
198 B
C++

#pragma once
#include <atomic>
typedef std::atomic<unsigned long> counter;
struct MaintainCount
{
counter & c;
MaintainCount(counter & c) : c(c) { c++; }
~MaintainCount() { c--; }
};