From 63422dfdcb1cd6827e76440cc147c9eac415952a Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 8 Jul 2019 15:00:58 +0200 Subject: [HICN-242] Perform only one allocation for the whole buffer passed to produce() Change-Id: Ib4628d0a7711e2d7175b3dbb5c152dd22616ff32 Signed-off-by: Mauro Sardara --- libtransport/src/hicn/transport/utils/content_store.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libtransport/src/hicn/transport/utils/content_store.cc') 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 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 ContentStore::find( const Interest &interest) { - std::unique_lock 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( @@ -78,7 +78,7 @@ const std::shared_ptr ContentStore::find( } void ContentStore::erase(const Name &exact_name) { - std::unique_lock 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); -- cgit 1.2.3-korg