From 0a46a6234dcd1eafe770cb78b5ac1ec7067e4400 Mon Sep 17 00:00:00 2001 From: Marco Realacci Date: Thu, 3 Apr 2025 18:32:36 +0200 Subject: [PATCH] vault backup: 2025-04-03 18:32:36 --- Concurrent Systems/test/Untitled.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Concurrent Systems/test/Untitled.md b/Concurrent Systems/test/Untitled.md index 3948923..01cf08d 100644 --- a/Concurrent Systems/test/Untitled.md +++ b/Concurrent Systems/test/Untitled.md @@ -73,8 +73,15 @@ operation end_write() := ``` CNT initalized to the value I want to initalize the semaphore +Condition S up() := if CNT < 0 then - + S.signal() + CNT++ + +down() := + CNT-- + if CNT < 0 then + S.wait() ``` \ No newline at end of file