WIP: (BUG) model run/load/create + typos corrected

This commit is contained in:
Adrien Bourmault 2021-07-02 15:19:08 +02:00
parent aa4bd4478c
commit e0a7cfe0b3
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
3 changed files with 14 additions and 19 deletions

View File

@ -26,25 +26,20 @@
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
// Supervisor init function // // Supervisor init function //
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
void SupervisorInit(Scheduler_t *scheduler); void SupervisorInit(Supervisor_t *supervisor);
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
// Supervisor destructor function // // Supervisor destructor function //
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
static inline void SupervisorDestroy(Scheduler_t *scheduler) static inline void SupervisorDestroy(Supervisor_t *supervisor)
{ {
free(scheduler->id); free(supervisor->id);
free(scheduler->globalDrawingSpace->space);
free(scheduler->globalDrawingSpace);
free(scheduler->arrowArray->array);
free(scheduler->arrowArray);
} }
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
// Supervisor wait function // // 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);
} }

View File

@ -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)); server->id = (pthread_t*) calloc(1, sizeof(pthread_t));
pthread_create(scheduler->id, NULL, serverMain, scheduler); pthread_create(server->id, NULL, serverMain, server);
} }
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //

View File

@ -21,23 +21,23 @@
#include "../include/base.h" #include "../include/base.h"
static void *supervisorMain(void *scheduler); static void *supervisorMain(void *supervisor);
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
// Supervisor init function // // Supervisor init function //
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
void SupervisorInit(Scheduler_t *scheduler) void SupervisorInit(Supervisor_t *supervisor)
{ {
scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t)); supervisor->id = (pthread_t*) calloc(1, sizeof(pthread_t));
pthread_create(scheduler->id, NULL, supervisorMain, scheduler); pthread_create(supervisor->id, NULL, supervisorMain, supervisor);
} }
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
// Supervisor thread main function // // Supervisor thread main function //
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
static void *supervisorMain(void *scheduler) static void *supervisorMain(void *supervisor)
{ {
return NULL; return NULL;
} }