mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 14:05:29 +03:00
22 lines
309 B
C++
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;
|
|
};
|
|
|
|
}
|
|
|
|
|