From 47ad6fa4563fcd983502fb3ee8e194fbabb65b3e Mon Sep 17 00:00:00 2001
From: Bah Thierno-Souleymane <thiernosouleymane.bah.etu@univ-lille.fr>
Date: Tue, 20 Apr 2021 02:38:49 +0200
Subject: [PATCH] feat(semanphore with scheduling done)
---
include/context.h | 2 ++
src/context.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/context.h b/include/context.h
index 6c38c33..f482268 100644
--- a/include/context.h
+++ b/include/context.h
@@ -11,6 +11,7 @@ typedef enum
{
CTX_INIT,
CTX_EXEC,
+ CTX_WAIT,
CTX_END
} ctx_status_t;
@@ -23,6 +24,7 @@ typedef struct ctx_s
void *args;
ctx_status_t status;
struct ctx_s *next_ctx;
+ struct ctx_s *sem_next_ctx;
char used;
} ctx_t;
diff --git a/src/context.c b/src/context.c
index d404885..bf0d435 100644
--- a/src/context.c
+++ b/src/context.c
@@ -1,8 +1,8 @@
#include "context.h"
#include "utils.h"
-static ctx_t *current_ctx = NULL;
-static ctx_t *ring_ctx = NULL;
+ctx_t *current_ctx = NULL;
+ctx_t *ring_ctx = NULL;
ctx_t *malloc_ctx()
{
--
GitLab