elks-enhanced
public
Read
Owner: themaster
Branch: master
Commits: 6893
Updated: 2026-04-19 00:15
Git CLI clone URL
git clone https://www.xt-emporium.com/git/elks-enhanced.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
elks-enhanced
/
elks
/
kernel
/
unused
/
lock.c
File editor
// Experimental lock functions - unused #include <linuxmt/sched.h> #include <linuxmt/cond.h> #include <linuxmt/lock.h> // Lock condition test static bool_t test_lock (void * lock) { return !try_lock ((lock_t *) lock); // 0: acquired } // Wait for lock void wait_lock (lock_t * lock) { // First try to save from wait_event overhead if (try_lock (lock)) // 1: not acquired { // The lock is acquired as soon as condition is verified cond_t cond = {.test = test_lock, .obj = (void *) lock}; wait_event (&cond); // uninterruptible } } // Unlock with event void event_unlock (lock_t * lock) { unlock (lock); // TODO: do not wake up all waiting tasks // but just one with top priority // wake_up_one (lock); wake_up ((struct wait_queue *) lock); }
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
master
Visibility
public
Your access
Read
Remote
Configured
File activity
View file history