Cleaning some unused things

This commit is contained in:
Adrien Bourmault 2021-06-21 10:34:11 +02:00
parent 322f90b20c
commit f0743ec795
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
7 changed files with 8 additions and 12 deletions

View File

@ -26,7 +26,7 @@
// -------------------------------------------------------------------------- //
// Worker init function //
// -------------------------------------------------------------------------- //
pthread_t *WorkerInit(Worker_t *worker);
void WorkerInit(Worker_t *worker);
// -------------------------------------------------------------------------- //
// Worker destructor function //

View File

@ -26,7 +26,7 @@
// -------------------------------------------------------------------------- //
// Scheduler init function //
// -------------------------------------------------------------------------- //
pthread_t *SchedInit(Scheduler_t *scheduler);
void SchedInit(Scheduler_t *scheduler);
// -------------------------------------------------------------------------- //
// Scheduler destructor function //

View File

@ -26,7 +26,7 @@
// -------------------------------------------------------------------------- //
// Server init function //
// -------------------------------------------------------------------------- //
pthread_t *ServerInit(Server_t *server);
void ServerInit(Server_t *server);
// -------------------------------------------------------------------------- //
// Server destructor function //

View File

@ -28,14 +28,13 @@ static void *workerMain(void *worker);
// -------------------------------------------------------------------------- //
// Scheduler init function //
// -------------------------------------------------------------------------- //
pthread_t *WorkerInit(Worker_t *worker)
void WorkerInit(Worker_t *worker)
{
worker->id = (pthread_t*) calloc(1, sizeof(pthread_t));
if (pthread_create(worker->id, NULL, workerMain, worker)) {
printLog("Worker #%lu can't be initialized!\n", *(worker->id));
return NULL;
}
return worker->id;
}
// -------------------------------------------------------------------------- //

View File

@ -21,7 +21,6 @@
#include "../include/base.h"
#include "../include/server.h"
#include "../include/scheduler.h"
int main(int argc, char **argv)
@ -32,18 +31,18 @@ int main(int argc, char **argv)
// Go!
printLog("Starting gem-graph-server...\n");
//
// random generator
//
t = time(&t);
srand((unsigned) t);
server0 = (Server_t*) calloc(1, sizeof(Server_t));
// Launching server
ServerInit(server0);
ServerWait(server0);
// Exiting
ServerDestroy(server0);
return 0;

View File

@ -32,11 +32,10 @@ static void *schedulerMain(void *scheduler);
// -------------------------------------------------------------------------- //
// Scheduler init function //
// -------------------------------------------------------------------------- //
pthread_t *SchedInit(Scheduler_t *scheduler)
void SchedInit(Scheduler_t *scheduler)
{
scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t));
pthread_create(scheduler->id, NULL, schedulerMain, scheduler);
return scheduler->id;
}
/* -------------------------------------------------------------------------- */

View File

@ -32,11 +32,10 @@ static void *serverMain(void *server);
// -------------------------------------------------------------------------- //
// Scheduler init function //
// -------------------------------------------------------------------------- //
pthread_t *ServerInit(Server_t *scheduler)
void ServerInit(Server_t *scheduler)
{
scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t));
pthread_create(scheduler->id, NULL, serverMain, scheduler);
return scheduler->id;
}
// -------------------------------------------------------------------------- //