diff options
author | David Tardon <dtardon@redhat.com> | 2010-12-26 10:29:06 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2010-12-26 10:29:06 +0100 |
commit | 3b34da87b5f2c99120c79cbfbbe8f7da0ff7837a (patch) | |
tree | ab5b4b249614abe0888095f658d8d539892ad52c /sal/rtl | |
parent | 5f110a9734e4f315f311ef9f705d8f357eeac54a (diff) |
avoid data race with wsupdate thread
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/source/alloc_cache.c | 6 |
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); |