diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-07-27 17:17:56 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-07-27 17:17:56 -0400 |
| commit | bb912b081ed339e4a5419bd3d2ffd7465f2f72d3 (patch) | |
| tree | 7f34b3af1a72672de1d12c8e23dda419c398dce3 /docs/application/mutex.md | |
| parent | 003119b9f285e5610f56186bce845441409265ae (diff) | |
bottom up redesign
Diffstat (limited to 'docs/application/mutex.md')
| -rw-r--r-- | docs/application/mutex.md | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/docs/application/mutex.md b/docs/application/mutex.md deleted file mode 100644 index e1b15c7..0000000 --- a/docs/application/mutex.md +++ /dev/null @@ -1,24 +0,0 @@ -# Mutex - ---- - -## Object Definitions - -```c -typedef struct { - kpl_task_queue queue; - _Atomic int32_t lock; -} kpl_mutex; -``` - -## Usage - -1. Before adding to the `queue` do `value = lock++` -2. Add to the queue -3. If `value` is `0` the thread does an async schedule of the mutex task, otherwise the thread moves on - -### Mutex Task - -1. Get task from `queue` and run task - * Use spinlock with `pasue`, the `lock` will be set before the task is added to the `queue` -2. After task completion, do `value = --lock`, stop if `value` is `0`, otherwise repeat |
