Cleaning some unused things
This commit is contained in:
parent
322f90b20c
commit
f0743ec795
|
@ -26,7 +26,7 @@
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Worker init function //
|
// Worker init function //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
pthread_t *WorkerInit(Worker_t *worker);
|
void WorkerInit(Worker_t *worker);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Worker destructor function //
|
// Worker destructor function //
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Scheduler init function //
|
// Scheduler init function //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
pthread_t *SchedInit(Scheduler_t *scheduler);
|
void SchedInit(Scheduler_t *scheduler);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Scheduler destructor function //
|
// Scheduler destructor function //
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Server init function //
|
// Server init function //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
pthread_t *ServerInit(Server_t *server);
|
void ServerInit(Server_t *server);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Server destructor function //
|
// Server destructor function //
|
||||||
|
|
|
@ -28,14 +28,13 @@ static void *workerMain(void *worker);
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Scheduler init function //
|
// Scheduler init function //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
pthread_t *WorkerInit(Worker_t *worker)
|
void WorkerInit(Worker_t *worker)
|
||||||
{
|
{
|
||||||
worker->id = (pthread_t*) calloc(1, sizeof(pthread_t));
|
worker->id = (pthread_t*) calloc(1, sizeof(pthread_t));
|
||||||
if (pthread_create(worker->id, NULL, workerMain, worker)) {
|
if (pthread_create(worker->id, NULL, workerMain, worker)) {
|
||||||
printLog("Worker #%lu can't be initialized!\n", *(worker->id));
|
printLog("Worker #%lu can't be initialized!\n", *(worker->id));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return worker->id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
#include "../include/base.h"
|
#include "../include/base.h"
|
||||||
#include "../include/server.h"
|
#include "../include/server.h"
|
||||||
#include "../include/scheduler.h"
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
@ -32,18 +31,18 @@ int main(int argc, char **argv)
|
||||||
// Go!
|
// Go!
|
||||||
printLog("Starting gem-graph-server...\n");
|
printLog("Starting gem-graph-server...\n");
|
||||||
|
|
||||||
//
|
|
||||||
// random generator
|
// random generator
|
||||||
//
|
|
||||||
t = time(&t);
|
t = time(&t);
|
||||||
srand((unsigned) t);
|
srand((unsigned) t);
|
||||||
|
|
||||||
server0 = (Server_t*) calloc(1, sizeof(Server_t));
|
server0 = (Server_t*) calloc(1, sizeof(Server_t));
|
||||||
|
|
||||||
|
// Launching server
|
||||||
ServerInit(server0);
|
ServerInit(server0);
|
||||||
|
|
||||||
ServerWait(server0);
|
ServerWait(server0);
|
||||||
|
|
||||||
|
// Exiting
|
||||||
ServerDestroy(server0);
|
ServerDestroy(server0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -32,11 +32,10 @@ static void *schedulerMain(void *scheduler);
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Scheduler init function //
|
// Scheduler init function //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
pthread_t *SchedInit(Scheduler_t *scheduler)
|
void SchedInit(Scheduler_t *scheduler)
|
||||||
{
|
{
|
||||||
scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t));
|
scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t));
|
||||||
pthread_create(scheduler->id, NULL, schedulerMain, scheduler);
|
pthread_create(scheduler->id, NULL, schedulerMain, scheduler);
|
||||||
return scheduler->id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
|
@ -32,11 +32,10 @@ static void *serverMain(void *server);
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Scheduler init function //
|
// Scheduler init function //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
pthread_t *ServerInit(Server_t *scheduler)
|
void ServerInit(Server_t *scheduler)
|
||||||
{
|
{
|
||||||
scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t));
|
scheduler->id = (pthread_t*) calloc(1, sizeof(pthread_t));
|
||||||
pthread_create(scheduler->id, NULL, serverMain, scheduler);
|
pthread_create(scheduler->id, NULL, serverMain, scheduler);
|
||||||
return scheduler->id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
Loading…
Reference in New Issue