mirror of
https://gitlab.com/klmp200/LO41.git
synced 2025-07-12 04:39:23 +00:00
Added remove_inside_List function. Experimental user removal.
This commit is contained in:
@ -40,6 +40,12 @@ void add_passenger_Elevator(THIS(Elevator), Passenger * passenger){
|
||||
pthread_mutex_unlock(&this->mutex_passengers);
|
||||
}
|
||||
|
||||
void remove_passenger_Elevator(THIS(Elevator), Passenger * passenger){
|
||||
pthread_mutex_lock(&this->mutex_passengers);
|
||||
this->passengers->remove_inside(this->passengers, passenger, passenger->compare);
|
||||
pthread_mutex_unlock(&this->mutex_passengers);
|
||||
}
|
||||
|
||||
int get_number_of_passengers_Elevator(THIS(Elevator)){
|
||||
int num;
|
||||
pthread_mutex_lock(&this->mutex_passengers);
|
||||
@ -127,6 +133,7 @@ void *runnable_Elevator(void * void_this){
|
||||
printf("DEBUG : Next passenger stop : %d\n", next_passenger_stop);
|
||||
printf("DEBUG : Next call from user : %d\n", next_call);
|
||||
printf("\n\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
this->set_floor(this, this->target_floor);
|
||||
}
|
||||
|
Reference in New Issue
Block a user