#include <l4/lock/lock.h> l4lock_t lock = L4LOCK_UNLOCKED; void test(void) { // enter the critical section l4lock_lock(&lock); // do the critical stuff // leave the critical section l4lock_unlock(&lock); }