mirror of
https://gitlab.com/klmp200/LO41.git
synced 2025-07-11 12:19:25 +00:00
Pthread KILL
This commit is contained in:
@ -71,6 +71,8 @@ void *runnable_Elevator(void * void_this){
|
||||
Elevator * this = (Elevator*) void_this;
|
||||
SharedData * data = GET_INSTANCE(SharedData);
|
||||
|
||||
AGENT_OPTIONS
|
||||
|
||||
printf("Je suis l'ascenseur %s\n", this->name);
|
||||
for (;;)
|
||||
data->main_building->signal_elevator_at_floor(data->main_building, this->get_floor(this));
|
||||
@ -79,7 +81,6 @@ void *runnable_Elevator(void * void_this){
|
||||
|
||||
Elevator *_init_Elevator(char * name){
|
||||
Elevator * new_elevator = malloc_or_die(sizeof(Elevator));
|
||||
new_elevator->state = WAITING;
|
||||
new_elevator->name = strdup(name);
|
||||
new_elevator->passenger_ids = NEW(List);
|
||||
pthread_mutex_init(&new_elevator->mutex_passenger, NULL);
|
||||
@ -98,5 +99,8 @@ Elevator *_init_Elevator(char * name){
|
||||
repair
|
||||
);
|
||||
|
||||
new_elevator->set_floor(new_elevator, 0);
|
||||
new_elevator->set_state(new_elevator, WAITING);
|
||||
|
||||
return new_elevator;
|
||||
}
|
Reference in New Issue
Block a user