next up previous contents index
Next: 9.6 Standard I/O Functions Up: 9.5 Memory Allocation Previous: 9.5.17 mem_lock: Lock access

9.5.18 mem_unlock: Unlock access to malloc memory pool

   

SYNOPSIS

#include <oskit/c/malloc.h>

void mem_unlock(void);

DESCRIPTION

This routine is called from any default memory allocation routine after all accesses to malloc_lmm are complete.

Coupled with mem_lock, this provides a way to make memory allocation thread and MP safe. In a multithreaded client OS, these functions will use the default lock implementation as provided by the lock manager (see Section 4.12), to protect accesses to the malloc_lmm. Or, these functions may be overridden with a suitable synchronization primitive.

Note that the kernel support library provides defaults for mem_lock and mem_unlock that call base_critical_enter and base_critical_leave respectively. However, you'll only get these versions if you use the kernel support library and link it in before the minimal C library.



University of Utah Flux Research Group