diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-03-11 20:15:10 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-03-11 20:15:10 +0200 |
commit | dfd0e9c97d80c5cd7115d6cbb49cce08168071b6 (patch) | |
tree | 7bb5c56c18c83f3180101e310198cb3e3fdf1ab7 /src/blockchain_db | |
parent | Merge pull request #711 (diff) | |
parent | Need to link boost::chrono in more places now (diff) | |
download | monero-dfd0e9c97d80c5cd7115d6cbb49cce08168071b6.tar.xz |
Merge pull request #712
66c2fc7 Need to link boost::chrono in more places now (Howard Chu)
b937a2c Use boost::thread instead of std::thread (Howard Chu)
Diffstat (limited to 'src/blockchain_db')
-rw-r--r-- | src/blockchain_db/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/blockchain_db/berkeleydb/db_bdb.cpp | 2 | ||||
-rw-r--r-- | src/blockchain_db/berkeleydb/db_bdb.h | 8 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/blockchain_db/CMakeLists.txt b/src/blockchain_db/CMakeLists.txt index 4953d92a6..39459d5c4 100644 --- a/src/blockchain_db/CMakeLists.txt +++ b/src/blockchain_db/CMakeLists.txt @@ -65,6 +65,7 @@ target_link_libraries(blockchain_db crypto cryptonote_core ${Boost_DATE_TIME_LIBRARY} + ${Boost_CHRONO_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY} ${LMDB_LIBRARY} diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp index bfdb22a10..1fef9e619 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.cpp +++ b/src/blockchain_db/berkeleydb/db_bdb.cpp @@ -135,7 +135,7 @@ const unsigned int DB_BUFFER_LENGTH = 32 * MB; const unsigned int DB_DEF_CACHESIZE = 256 * MB; #if defined(BDB_BULK_CAN_THREAD) -const unsigned int DB_BUFFER_COUNT = std::thread::hardware_concurrency(); +const unsigned int DB_BUFFER_COUNT = boost::thread::hardware_concurrency(); #else const unsigned int DB_BUFFER_COUNT = 1; #endif diff --git a/src/blockchain_db/berkeleydb/db_bdb.h b/src/blockchain_db/berkeleydb/db_bdb.h index bf9665cae..d7cbd24e7 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.h +++ b/src/blockchain_db/berkeleydb/db_bdb.h @@ -130,7 +130,7 @@ public: T acquire_buffer() { - std::unique_lock<std::mutex> lock(m_lock); + boost::unique_lock<boost::mutex> lock(m_lock); m_cv.wait(lock, [&]{ return m_count > 0; }); --m_count; @@ -154,7 +154,7 @@ public: void release_buffer(T buffer) { - std::unique_lock<std::mutex> lock(m_lock); + boost::unique_lock<boost::mutex> lock(m_lock); assert(buffer != nullptr); auto it = m_buffer_map.find(buffer); @@ -196,10 +196,10 @@ private: std::vector<T> m_buffers; std::unordered_map<T, size_t> m_buffer_map; - std::condition_variable m_cv; + boost::condition_variable m_cv; std::vector<bool> m_open_slot; size_t m_count; - std::mutex m_lock; + boost::mutex m_lock; size_t m_buffer_count; }; |