diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2012-06-27 00:31:38 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2012-06-27 00:31:38 +0400 |
commit | 3c7b7ac9f59539c66884191231cf7e880f23be72 (patch) | |
tree | e3d2eb42141bbb56a0fba715bfb3ff002ce3190b /mert | |
parent | a4f69bb18722e8c2fbfac0c246bb6e874945b4de (diff) |
rollback
Diffstat (limited to 'mert')
-rw-r--r-- | mert/Vocabulary.cpp | 14 | ||||
-rw-r--r-- | mert/Vocabulary.h | 9 |
2 files changed, 0 insertions, 23 deletions
diff --git a/mert/Vocabulary.cpp b/mert/Vocabulary.cpp index 744917d21..ccabe2d84 100644 --- a/mert/Vocabulary.cpp +++ b/mert/Vocabulary.cpp @@ -7,34 +7,20 @@ Vocabulary* g_vocab = NULL; } // namespace int Vocabulary::Encode(const std::string& token) { -#ifdef WITH_THREADS - boost::upgrade_lock<boost::shared_mutex> read_lock(m_accessLock); -#endif // WITH_THREADS - iterator it = m_vocab.find(token); int encoded_token; if (it == m_vocab.end()) { // Add an new entry to the vocaburary. encoded_token = static_cast<int>(m_vocab.size()); -#ifdef WITH_THREADS - boost::upgrade_to_unique_lock<boost::shared_mutex> uniqueLock(read_lock); -#endif // WITH_THREADS - m_vocab[token] = encoded_token; } else { -#ifdef WITH_THREADS - boost::upgrade_to_unique_lock<boost::shared_mutex> uniqueLock(read_lock); -#endif // WITH_THREADS encoded_token = it->second; } return encoded_token; } bool Vocabulary::Lookup(const std::string&str , int* v) const { -#ifdef WITH_THREADS - boost::shared_lock<boost::shared_mutex> read_lock(m_accessLock); -#endif // WITH_THREADS const_iterator it = m_vocab.find(str); if (it == m_vocab.end()) return false; diff --git a/mert/Vocabulary.h b/mert/Vocabulary.h index 52c088f18..0d9291260 100644 --- a/mert/Vocabulary.h +++ b/mert/Vocabulary.h @@ -4,10 +4,6 @@ #include <map> #include <string> -#ifdef WITH_THREADS -#include <boost/thread/shared_mutex.hpp> -#endif - namespace mert { /** @@ -51,11 +47,6 @@ class Vocabulary { private: std::map<std::string, int> m_vocab; -#ifdef WITH_THREADS - //reader-writer lock - mutable boost::shared_mutex m_accessLock; -#endif - }; class VocabularyFactory { |