mosesdecoder/moses/TranslationModel/UG/generic/threading/ug_thread_safe_counter.h
2014-03-24 12:33:17 +00:00

22 lines
309 B
C++

#pragma once
#include <boost/thread.hpp>
namespace Moses
{
class ThreadSafeCounter
{
size_t ctr;
boost::mutex lock;
public:
ThreadSafeCounter();
size_t operator++();
size_t operator++(int);
size_t operator--();
size_t operator--(int);
operator size_t() const;
};
}