bounds checking and changes to the pthread signals
This commit is contained in:
13
threading.c
13
threading.c
@@ -87,6 +87,12 @@ void *thread_mid(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mid_dir.current_file > mid_dir.file_list + mid_dir.file_count - 1) {
|
||||||
|
mid_dir.current_file = mid_dir.file_list + mid_dir.file_count - 1;
|
||||||
|
}
|
||||||
|
if (mid_dir.current_file < mid_dir.file_list) {
|
||||||
|
mid_dir.current_file = mid_dir.file_list;
|
||||||
|
}
|
||||||
|
|
||||||
/* rendering */
|
/* rendering */
|
||||||
werase(win_m);
|
werase(win_m);
|
||||||
@@ -96,12 +102,13 @@ void *thread_mid(){
|
|||||||
print_dir(win_m, 1, &mid_dir);
|
print_dir(win_m, 1, &mid_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pthread_cond_signal(&cond_rgt);
|
||||||
|
pthread_cond_signal(&cond_top);
|
||||||
|
pthread_cond_signal(&cond_btm);
|
||||||
pthread_mutex_unlock(&mutex_mid);
|
pthread_mutex_unlock(&mutex_mid);
|
||||||
|
|
||||||
pthread_cond_signal(&cond_rgt);
|
|
||||||
|
|
||||||
btm_status = local_status;
|
btm_status = local_status;
|
||||||
pthread_cond_signal(&cond_btm);
|
|
||||||
|
|
||||||
|
|
||||||
long i;
|
long i;
|
||||||
@@ -219,8 +226,6 @@ void *thread_rgt(){
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rendering */
|
/* rendering */
|
||||||
|
|||||||
Reference in New Issue
Block a user