1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-10 19:59:24 +00:00

BEHOLD ! The threadinator !

This commit is contained in:
2018-06-11 01:58:52 +02:00
parent bd5860579e
commit fd2463904a
10 changed files with 110 additions and 78 deletions

View File

@ -8,6 +8,12 @@
GETTER(Visitor, char*, name);
GETTER(Visitor, int, id);
void * runnable_Visitor(void * void_this){
Visitor *this = (Visitor*) void_this;
printf("Bonjour, je suis %s et je souhaite rendre visite a %s\n", this->name, this->contact_name);
return NULL;
}
void _free__Visitor(THIS(Visitor)){
if (this->name != NULL)
free(this->name);
@ -30,7 +36,8 @@ Visitor *_init_Visitor(int id, char* name, char * contact_name){
LINK_ALL(Visitor, new_visitor,
get_name,
get_id
get_id,
runnable
);
return new_visitor;

View File

@ -14,6 +14,7 @@ typedef struct o_Visitor {
PRIVATE int position;
PRIVATE int destination;
PUBLIC void * (*runnable)(void* void_this);
PUBLIC char * (*get_name)(_THIS(Visitor));
PUBLIC int (*get_id)(_THIS(Visitor));