L4Re Operating System Framework – Interface and Usage Documentation
|
Thread safe version of counter for Counting_cap_alloc. More...
#include <counting_cap_alloc>
Thread safe version of counter for Counting_cap_alloc.
Despite using atomic instructions, this version has to make sure that capability slots are not reused too early. If the last reference is gone, the capability slot has to be unmapped. The slot must only be allocated again when the unmap has completed. This is accomplished by starting with an initial count of 2. The last reference will decrease the counter to 1. Only then, after the slot was unmapped, will the counter be set to 0. This will allow other threads to reallocate the slot.
Definition at line 73 of file counting_cap_alloc.