mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 23:58:15 +03:00
use c++11 thread local construct instead of boost
This commit is contained in:
parent
fdabcd34f8
commit
745e03b4fc
@ -20,6 +20,9 @@ using namespace std;
|
|||||||
namespace Moses2
|
namespace Moses2
|
||||||
{
|
{
|
||||||
|
|
||||||
|
thread_local MemPool System::m_managerPool;
|
||||||
|
thread_local MemPool System::m_systemPool;
|
||||||
|
|
||||||
System::System(const Parameter ¶msArg) :
|
System::System(const Parameter ¶msArg) :
|
||||||
params(paramsArg), featureFunctions(*this)
|
params(paramsArg), featureFunctions(*this)
|
||||||
{
|
{
|
||||||
@ -163,12 +166,12 @@ void System::LoadDecodeGraphBackoff()
|
|||||||
|
|
||||||
MemPool &System::GetSystemPool() const
|
MemPool &System::GetSystemPool() const
|
||||||
{
|
{
|
||||||
return GetThreadSpecificObj(m_systemPool);
|
return m_systemPool;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemPool &System::GetManagerPool() const
|
MemPool &System::GetManagerPool() const
|
||||||
{
|
{
|
||||||
return GetThreadSpecificObj(m_managerPool);
|
return m_managerPool;
|
||||||
}
|
}
|
||||||
|
|
||||||
FactorCollection &System::GetVocab() const
|
FactorCollection &System::GetVocab() const
|
||||||
|
@ -65,11 +65,15 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
mutable FactorCollection m_vocab;
|
mutable FactorCollection m_vocab;
|
||||||
mutable boost::thread_specific_ptr<MemPool> m_managerPool;
|
//mutable boost::thread_specific_ptr<MemPool> m_managerPool;
|
||||||
mutable boost::thread_specific_ptr<MemPool> m_systemPool;
|
//mutable boost::thread_specific_ptr<MemPool> m_systemPool;
|
||||||
|
thread_local static MemPool m_managerPool;
|
||||||
|
thread_local static MemPool m_systemPool;
|
||||||
|
|
||||||
mutable boost::thread_specific_ptr<Recycler<HypothesisBase*> > m_hypoRecycler;
|
mutable boost::thread_specific_ptr<Recycler<HypothesisBase*> > m_hypoRecycler;
|
||||||
|
|
||||||
|
//thread_local static MemPool d;
|
||||||
|
|
||||||
mutable boost::thread_specific_ptr<Batch> m_batch;
|
mutable boost::thread_specific_ptr<Batch> m_batch;
|
||||||
|
|
||||||
void LoadWeights();
|
void LoadWeights();
|
||||||
|
Loading…
Reference in New Issue
Block a user