summaryrefslogtreecommitdiff
path: root/sal/rtl
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2010-12-26 10:29:06 +0100
committerDavid Tardon <dtardon@redhat.com>2010-12-26 10:29:06 +0100
commitf9344d0a6cb06ccb31defea83e163cf15091104a (patch)
tree9f1f2e808be5ca072ab77fed57860869250e6c55 /sal/rtl
parent427c25e92805b0a346acaa87275534936be94b42 (diff)
avoid data race with wsupdate thread
Diffstat (limited to 'sal/rtl')
-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 916461e04..42df973a4 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);