mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-22 23:58:52 +00:00
Merge pull request #4875
23829ebb
mlocker: don't throw from lock/unlock (moneromooo-monero)
This commit is contained in:
commit
f6e8ab0dc6
@ -114,6 +114,8 @@ namespace epee
|
|||||||
|
|
||||||
void mlocker::lock(void *ptr, size_t len)
|
void mlocker::lock(void *ptr, size_t len)
|
||||||
{
|
{
|
||||||
|
TRY_ENTRY();
|
||||||
|
|
||||||
size_t page_size = get_page_size();
|
size_t page_size = get_page_size();
|
||||||
if (page_size == 0)
|
if (page_size == 0)
|
||||||
return;
|
return;
|
||||||
@ -124,10 +126,14 @@ namespace epee
|
|||||||
for (size_t page = first; page <= last; ++page)
|
for (size_t page = first; page <= last; ++page)
|
||||||
lock_page(page);
|
lock_page(page);
|
||||||
++num_locked_objects;
|
++num_locked_objects;
|
||||||
|
|
||||||
|
CATCH_ENTRY_L1("mlocker::lock", void());
|
||||||
}
|
}
|
||||||
|
|
||||||
void mlocker::unlock(void *ptr, size_t len)
|
void mlocker::unlock(void *ptr, size_t len)
|
||||||
{
|
{
|
||||||
|
TRY_ENTRY();
|
||||||
|
|
||||||
size_t page_size = get_page_size();
|
size_t page_size = get_page_size();
|
||||||
if (page_size == 0)
|
if (page_size == 0)
|
||||||
return;
|
return;
|
||||||
@ -137,6 +143,8 @@ namespace epee
|
|||||||
for (size_t page = first; page <= last; ++page)
|
for (size_t page = first; page <= last; ++page)
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
--num_locked_objects;
|
--num_locked_objects;
|
||||||
|
|
||||||
|
CATCH_ENTRY_L1("mlocker::lock", void());
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t mlocker::get_num_locked_pages()
|
size_t mlocker::get_num_locked_pages()
|
||||||
|
Loading…
Reference in New Issue
Block a user