diff options
Diffstat (limited to 'libtransport/src/hicn/transport/utils')
-rw-r--r-- | libtransport/src/hicn/transport/utils/content_store.cc | 6 | ||||
-rw-r--r-- | libtransport/src/hicn/transport/utils/content_store.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libtransport/src/hicn/transport/utils/content_store.cc b/libtransport/src/hicn/transport/utils/content_store.cc index c3864310e..1e6b9fcea 100644 --- a/libtransport/src/hicn/transport/utils/content_store.cc +++ b/libtransport/src/hicn/transport/utils/content_store.cc @@ -31,7 +31,7 @@ void ContentStore::insert( return; } - std::unique_lock<std::mutex> lock(cs_mutex_); + utils::SpinLock::Acquire locked(cs_mutex_); if (TRANSPORT_EXPECT_FALSE(content_store_hash_table_.size() != fifo_list_.size())) { @@ -64,7 +64,7 @@ void ContentStore::insert( const std::shared_ptr<ContentObject> ContentStore::find( const Interest &interest) { - std::unique_lock<std::mutex> lock(cs_mutex_); + utils::SpinLock::Acquire locked(cs_mutex_); auto it = content_store_hash_table_.find(interest.getName()); if (it != content_store_hash_table_.end()) { if (std::chrono::duration_cast<std::chrono::milliseconds>( @@ -78,7 +78,7 @@ const std::shared_ptr<ContentObject> ContentStore::find( } void ContentStore::erase(const Name &exact_name) { - std::unique_lock<std::mutex> lock(cs_mutex_); + utils::SpinLock::Acquire locked(cs_mutex_); auto it = content_store_hash_table_.find(exact_name); fifo_list_.erase(it->second.second); content_store_hash_table_.erase(exact_name); diff --git a/libtransport/src/hicn/transport/utils/content_store.h b/libtransport/src/hicn/transport/utils/content_store.h index ba8ee5bd2..a89403a01 100644 --- a/libtransport/src/hicn/transport/utils/content_store.h +++ b/libtransport/src/hicn/transport/utils/content_store.h @@ -69,7 +69,7 @@ class ContentStore { FIFOList fifo_list_; std::shared_ptr<ContentObject> empty_reference_; std::size_t max_content_store_size_; - std::mutex cs_mutex_; + utils::SpinLock cs_mutex_; }; } // end namespace utils
\ No newline at end of file |