1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-12 04:39:23 +00:00

Auront-ont vaincu la préemption ?

This commit is contained in:
Aethor
2018-06-22 00:48:43 +02:00
parent 7b2e3432ea
commit 86dabd455a
4 changed files with 12 additions and 10 deletions

View File

@ -206,7 +206,9 @@ void go_to_floor_Building(THIS(Building), int origin, int destination, Passenger
elevator_number = this->get_inside_elevator(this, origin, passenger);
if (elevator_number != -1){ //passenger accepted in elevator
this->waiting_floors[origin]--;//on retire de la liste des attentes
pthread_mutex_lock(this->mutex_cond_get_outside_elevator);
pthread_cond_wait(this->condition_floors[destination], this->mutex_cond_get_outside_elevator);
pthread_mutex_unlock(this->mutex_cond_get_outside_elevator);
this->elevators[elevator_number]->remove_passenger(this->elevators[elevator_number], passenger);
}else{
if (passenger->type == RESIDENT)