mirror of
https://gitlab.com/klmp200/LO41.git
synced 2025-07-15 14:19:24 +00:00
~
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user