summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sal/rtl/source/alloc_cache.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sal/rtl/source/alloc_cache.c b/sal/rtl/source/alloc_cache.c
index 51e675c39316..01d4e14961f8 100644
--- a/sal/rtl/source/alloc_cache.c
+++ b/sal/rtl/source/alloc_cache.c
@@ -1189,10 +1189,9 @@ SAL_CALL rtl_cache_alloc (
if (cache == 0)
return (0);
+ RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
if (cache->m_cpu_curr != 0)
{
- RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
-
for (;;)
{
/* take object from magazine layer */
@@ -1230,9 +1229,8 @@ SAL_CALL rtl_cache_alloc (
/* no full magazine: fall through to slab layer */
break;
}
-
- RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));
}
+ RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));
/* alloc buffer from slab layer */
obj = rtl_cache_slab_alloc (cache);