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 //
// -------------------------------------------------------------------------- //
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);
}

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

View File

@ -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;
}