From e0a7cfe0b3b02b17375f1b7e04917642dd8af695 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Fri, 2 Jul 2021 15:19:08 +0200 Subject: [PATCH] WIP: (BUG) model run/load/create + typos corrected --- include/supervisor.h | 15 +++++---------- src/server.c | 8 ++++---- src/supervisor.c | 10 +++++----- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/include/supervisor.h b/include/supervisor.h index 724f3a6..d7b4e67 100644 --- a/include/supervisor.h +++ b/include/supervisor.h @@ -26,25 +26,20 @@ // -------------------------------------------------------------------------- // // Supervisor init function // // -------------------------------------------------------------------------- // -void SupervisorInit(Scheduler_t *scheduler); +void SupervisorInit(Supervisor_t *supervisor); // -------------------------------------------------------------------------- // // Supervisor destructor function // // -------------------------------------------------------------------------- // -static inline void SupervisorDestroy(Scheduler_t *scheduler) +static inline void SupervisorDestroy(Supervisor_t *supervisor) { - free(scheduler->id); - free(scheduler->globalDrawingSpace->space); - free(scheduler->globalDrawingSpace); - - free(scheduler->arrowArray->array); - free(scheduler->arrowArray); + free(supervisor->id); } // -------------------------------------------------------------------------- // // Supervisor wait function // // -------------------------------------------------------------------------- // -static inline void SupervisorWait(Scheduler_t *scheduler) +static inline void SupervisorWait(Supervisor_t *supervisor) { - pthread_join(*scheduler->id, NULL); + pthread_join(*supervisor->id, NULL); } diff --git a/src/server.c b/src/server.c index 3298488..2174667 100644 --- a/src/server.c +++ b/src/server.c @@ -30,12 +30,12 @@ static void *serverMain(void *server); /* -------------------------------------------------------------------------- */ // -------------------------------------------------------------------------- // -// Scheduler init function // +// Server init function // // -------------------------------------------------------------------------- // -void ServerInit(Server_t *scheduler) +void ServerInit(Server_t *server) { - scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t)); - pthread_create(scheduler->id, NULL, serverMain, scheduler); + server->id = (pthread_t*) calloc(1, sizeof(pthread_t)); + pthread_create(server->id, NULL, serverMain, server); } // -------------------------------------------------------------------------- // diff --git a/src/supervisor.c b/src/supervisor.c index 7dd6c27..d173719 100644 --- a/src/supervisor.c +++ b/src/supervisor.c @@ -21,23 +21,23 @@ #include "../include/base.h" -static void *supervisorMain(void *scheduler); +static void *supervisorMain(void *supervisor); /* -------------------------------------------------------------------------- */ // -------------------------------------------------------------------------- // // Supervisor init function // // -------------------------------------------------------------------------- // -void SupervisorInit(Scheduler_t *scheduler) +void SupervisorInit(Supervisor_t *supervisor) { - scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t)); - pthread_create(scheduler->id, NULL, supervisorMain, scheduler); + supervisor->id = (pthread_t*) calloc(1, sizeof(pthread_t)); + pthread_create(supervisor->id, NULL, supervisorMain, supervisor); } // -------------------------------------------------------------------------- // // Supervisor thread main function // // -------------------------------------------------------------------------- // -static void *supervisorMain(void *scheduler) +static void *supervisorMain(void *supervisor) { return NULL; }