mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 23:10:31 +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
|
||||
{
|
||||
|
||||
thread_local MemPool System::m_managerPool;
|
||||
thread_local MemPool System::m_systemPool;
|
||||
|
||||
System::System(const Parameter ¶msArg) :
|
||||
params(paramsArg), featureFunctions(*this)
|
||||
{
|
||||
@ -163,12 +166,12 @@ void System::LoadDecodeGraphBackoff()
|
||||
|
||||
MemPool &System::GetSystemPool() const
|
||||
{
|
||||
return GetThreadSpecificObj(m_systemPool);
|
||||
return m_systemPool;
|
||||
}
|
||||
|
||||
MemPool &System::GetManagerPool() const
|
||||
{
|
||||
return GetThreadSpecificObj(m_managerPool);
|
||||
return m_managerPool;
|
||||
}
|
||||
|
||||
FactorCollection &System::GetVocab() const
|
||||
|
@ -65,11 +65,15 @@ public:
|
||||
|
||||
protected:
|
||||
mutable FactorCollection m_vocab;
|
||||
mutable boost::thread_specific_ptr<MemPool> m_managerPool;
|
||||
mutable boost::thread_specific_ptr<MemPool> m_systemPool;
|
||||
//mutable boost::thread_specific_ptr<MemPool> m_managerPool;
|
||||
//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;
|
||||
|
||||
//thread_local static MemPool d;
|
||||
|
||||
mutable boost::thread_specific_ptr<Batch> m_batch;
|
||||
|
||||
void LoadWeights();
|
||||
|
Loading…
Reference in New Issue
Block a user