mirror of
https://gitlab.com/klmp200/LO41.git
synced 2026-10-22 18:29:36 +00:00
Added remove_inside_List function. Experimental user removal.
This commit is contained in:
1 parent
12c4e1af19
commit
55126c9ca6
3 files changed
+55
-16
No files matched your search
@@ -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