1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-15 14:19:24 +00:00
This commit is contained in:
Aethor
2018-06-22 05:49:15 +02:00
parent 3334f77d22
commit 7f160f69f8
4 changed files with 44 additions and 35 deletions

View File

@ -47,10 +47,7 @@ void start_all_threads_SharedData(THIS(SharedData)){
pthread_mutex_lock(&this->mutex_active_passengers);
pthread_mutex_lock(&this->mutex_threads);
/* starting the elevator breaker */
this->start_thread(this, this->elevator_breaker->runnable, this->elevator_breaker, 0);
this->elevator_breaker->set_thread_number(this->elevator_breaker, 0);
/* starts threading elevators */
for (i=1; i<ELEVATOR_NB; i++) {
this->start_thread(this, this->main_building->elevators[i]->runnable,
@ -77,6 +74,11 @@ void start_all_threads_SharedData(THIS(SharedData)){
this->active_passengers++;
i++;
}
/* starting the elevator breaker */
this->start_thread(this, this->elevator_breaker->runnable, this->elevator_breaker, 0);
this->elevator_breaker->set_thread_number(this->elevator_breaker, 0);
pthread_mutex_unlock(&this->mutex_threads);
pthread_mutex_unlock(&this->mutex_active_passengers);
}