From e29425af3c9ac47242856783f1c5e2fbaebc8de3 Mon Sep 17 00:00:00 2001
From: Amlal <amlal@nekernel.org>
Date: Wed, 13 Aug 2025 03:22:05 +0200
Subject: feat: tex: new revision of tex specs.

Signed-off-by: Amlal <amlal@nekernel.org>
---
 docs/tex/binary_mutex.tex | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

(limited to 'docs/tex/binary_mutex.tex')

diff --git a/docs/tex/binary_mutex.tex b/docs/tex/binary_mutex.tex
index cc5a7d3c..564d322a 100644
--- a/docs/tex/binary_mutex.tex
+++ b/docs/tex/binary_mutex.tex
@@ -13,7 +13,9 @@
 
 {The BinaryMutex is a core component of NeKernel (NeKernel/VMKernel) based systems. The pattern excludes other acquirers to own the USER\_PROCESS that is currently being hold. Thus the acquiree is the USER\_PROCESS itself}
 
-\section{Use Case \#1: Process lock for atomic data retrival}
+\section{Overview}
+
+{The BinaryMutex comes from the need to make sure that no race conditions occurs in kernel code. Most of those race conditions happens in process handling code. Thus the design of the BinaryMutex (which holds a process handle to it)}
 
 \begin{verbatim}
 BinaryMutex mux;
@@ -22,14 +24,16 @@ mux.Lock(process);
 // Say we want to interact with the process itself on this thread, 
 we can then make sure that no race condition happens by using:
 constexpr auto kSecondsMax = 5;
-mux.WaitForProcess(kSecondsMax);
+while (mux.WaitForProcess(kSecondsMax));
+
+// finally do our task now.
 
 process.DoFoo();
 \end{verbatim}
 
 \section{Implementation}
 
-The source implementation consists of:
+The source implementation consists of this simple C++ class:
 
 \begin{verbatim}
 class BinaryMutex final {
@@ -58,6 +62,15 @@ class BinaryMutex final {
 
 \section{Conclusion}
 
-This pattern is useful for systems that need to make sure that a process isn't tampered by concurrent usages. Thus its existence in VMKernel and NeKernel.
+{This design pattern is useful for systems that need to make sure that a process isn't tampered by concurrent usages.
+Thus its existence in VMKernel and NeKernel.}
+
+\section{References}
+
+{NeKernel}: \href{https://github.com/nekernel-org/nekernel}{NeKernel}
+
+{VMKernel}: \href{https://snu.systems/specs/vmkernel}{VMKernel}
+
+{BinaryMutex}: \href{https://github.com/nekernel-org/nekernel/blob/dev/dev/kernel/KernelKit/BinaryMutex.h}{BinaryMutex}
 
 \end{document}
-- 
cgit v1.2.3

