handling of empty dirs & refactoring
This commit is contained in:
30
main.c
30
main.c
@ -66,28 +66,30 @@ int main(){
|
||||
temp_width = terminal_width;
|
||||
temp_heigth = terminal_height;
|
||||
}
|
||||
if (status & STATUS_RUN_BACKEND && threading) {
|
||||
pthread_cancel(thread_b);
|
||||
pthread_cancel(thread_r);
|
||||
pthread_cancel(thread_m);
|
||||
pthread_cancel(thread_l);
|
||||
pthread_cancel(thread_t);
|
||||
}
|
||||
if (threading) {
|
||||
pthread_join(thread_b, NULL);
|
||||
pthread_join(thread_r, NULL);
|
||||
pthread_join(thread_m, NULL);
|
||||
pthread_join(thread_l, NULL);
|
||||
pthread_join(thread_t, NULL);
|
||||
threading = 0;
|
||||
}
|
||||
if (status & STATUS_RUN_BACKEND) {
|
||||
if (threading) {
|
||||
pthread_cancel(thread_t);
|
||||
pthread_cancel(thread_l);
|
||||
pthread_cancel(thread_m);
|
||||
pthread_cancel(thread_r);
|
||||
pthread_cancel(thread_b);
|
||||
pthread_join(thread_b, NULL);
|
||||
pthread_join(thread_r, NULL);
|
||||
pthread_join(thread_m, NULL);
|
||||
pthread_join(thread_l, NULL);
|
||||
pthread_join(thread_t, NULL);
|
||||
threading = 0;
|
||||
}
|
||||
pthread_create(&thread_t, NULL, thread_top, win_t); /*top bar*/
|
||||
pthread_create(&thread_l, NULL, thread_lft, win_l); /*current_content slash win_m*/
|
||||
pthread_create(&thread_m, NULL, thread_mid, win_m); /*parent_content slash win_l*/
|
||||
pthread_create(&thread_r, NULL, thread_rgt, win_r); /*child_content slash win_r*/
|
||||
pthread_create(&thread_b, NULL, thread_btm, win_b); /*bottom bar*/
|
||||
threading = 1;
|
||||
status &= ~(STATUS_RUN_BACKEND | STATUS_RELOAD_DIRECTORY);
|
||||
status |= STATUS_UPDATE_SCREEN_0;
|
||||
threading = 1;
|
||||
}
|
||||
user_interactions();
|
||||
|
||||
|
Reference in New Issue
Block a user