core/linux/os.c
/* HACK to get recursive write lock for internal and external use
 * FIXME: code blatantly copied from dynamo_vm_areas_{un}lock(); eliminate duplication!
 */
HACK to get recursive write lock for internal and external use
FIXME: code blatantly copied from dynamo_vm_areas_{un}lock(); eliminate duplication!
HACK to get recursive write lock for internal and external use FIXME : code blatantly copied from dynamo_vm_areas_ { un } lock () ; eliminate duplication!
void
all_memory_areas_lock()
{
    ASSERT(all_memory_areas != NULL ||
           get_num_threads() <= 1 );
    if (all_memory_areas == NULL)
        return;
    if (self_owns_write_lock(&all_memory_areas->lock)) {
        all_memory_areas_recursion++;
        ASSERT_CURIOSITY(all_memory_areas_recursion <= 4);
    } else
        write_lock(&all_memory_areas->lock);
}
void all_memory_areas_lock ( ) { ASSERT ( all_memory_areas != NULL || get_num_threads ( ) <= 1 ) ; if ( all_memory_areas == NULL ) return ; if ( self_owns_write_lock ( & all_memory_areas -> lock ) ) { all_memory_areas_recursion ++ ; ASSERT_CURIOSITY ( all_memory_areas_recursion <= 4 ) ; } else write_lock ( & all_memory_areas -> lock ) ; }
HACK to get recursive write lock for internal and external use
 FIXME: code blatantly copied from dynamo_vm_areas_{un}lock(); eliminate duplication!
HACK to get recursive write lock for internal and external use FIXME : code blatantly copied from dynamo_vm_areas_ { un } lock () ; eliminate duplication!
/* ok to ask for locks or mark stale before all_memory_areas is allocated,
     * during heap init and before we can allocate it.  no lock needed then.
     */ /* must be only DR thread */ /* we have a 5-deep path:
         *   global_heap_alloc | heap_create_unit | get_guarded_real_memory | 
         *   heap_low_on_memory | release_guarded_real_memory
         */