aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-12-04 17:15:07 +0200
committerRiccardo Spagni <ric@spagni.net>2018-12-04 17:15:07 +0200
commitf6e8ab0dc664b4941beb79dbcf5ff36c929d17c6 (patch)
treefa6caa2097a336bc407f62b9cdf883e84de06a32 /contrib/epee
parentMerge pull request #4872 (diff)
parentmlocker: don't throw from lock/unlock (diff)
downloadmonero-f6e8ab0dc664b4941beb79dbcf5ff36c929d17c6.tar.xz
Merge pull request #4875
23829ebb mlocker: don't throw from lock/unlock (moneromooo-monero)
Diffstat (limited to 'contrib/epee')
-rw-r--r--contrib/epee/src/mlocker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/epee/src/mlocker.cpp b/contrib/epee/src/mlocker.cpp
index 09ef861ac..807e60984 100644
--- a/contrib/epee/src/mlocker.cpp
+++ b/contrib/epee/src/mlocker.cpp
@@ -114,6 +114,8 @@ namespace epee
void mlocker::lock(void *ptr, size_t len)
{
+ TRY_ENTRY();
+
size_t page_size = get_page_size();
if (page_size == 0)
return;
@@ -124,10 +126,14 @@ namespace epee
for (size_t page = first; page <= last; ++page)
lock_page(page);
++num_locked_objects;
+
+ CATCH_ENTRY_L1("mlocker::lock", void());
}
void mlocker::unlock(void *ptr, size_t len)
{
+ TRY_ENTRY();
+
size_t page_size = get_page_size();
if (page_size == 0)
return;
@@ -137,6 +143,8 @@ namespace epee
for (size_t page = first; page <= last; ++page)
unlock_page(page);
--num_locked_objects;
+
+ CATCH_ENTRY_L1("mlocker::lock", void());
}
size_t mlocker::get_num_locked_pages()