From 69f9a609e59d75d70883e809512a0cf2fc88000d Mon Sep 17 00:00:00 2001 From: nova Date: Sat, 30 Aug 2025 21:01:40 +0200 Subject: [PATCH] removal of socal_status --- threading.c | 19 ++++++------------- threading.h | 10 +++++----- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/threading.c b/threading.c index 761dcc4..f629847 100644 --- a/threading.c +++ b/threading.c @@ -47,7 +47,7 @@ extern unsigned int terminal_width; extern unsigned int status; -void *thread_mid(void *data){ +void *thread_mid(){ while(!(status & STATUS_QUIT_PROGRAM)){ pthread_mutex_lock(&mutex_mid); @@ -99,8 +99,7 @@ void *thread_mid(void *data){ } pthread_exit(0); } -void *thread_lft(void *data){ - unsigned int local_status = *(unsigned int*)data; +void *thread_lft(){ while(!(status & STATUS_QUIT_PROGRAM)){ pthread_mutex_lock(&mutex_lft); @@ -116,7 +115,7 @@ void *thread_lft(void *data){ path[strrchr(path, '/')-path] = '\0'; path[0] = '/'; - if (local_status & STATUS_RELOAD_DIRECTORY) { + if (status & STATUS_RELOAD_DIRECTORY) { lft_file_count = get_dir_size(path); free(lft_content); lft_content = malloc(lft_file_count * sizeof(file)); @@ -132,9 +131,7 @@ void *thread_lft(void *data){ } -void *thread_rgt(void *data){ - unsigned int local_status = *(unsigned int*)data; - (void)local_status; +void *thread_rgt(){ file file_current; while(!(status & STATUS_QUIT_PROGRAM)){ @@ -216,9 +213,7 @@ void *thread_rgt(void *data){ } pthread_exit(0); } -void *thread_top(void *data){ - unsigned int local_status = *(unsigned int*)data; - (void)local_status; +void *thread_top(){ while(!(status & STATUS_QUIT_PROGRAM)){ pthread_mutex_lock(&mutex_top); @@ -241,9 +236,7 @@ void *thread_top(void *data){ } pthread_exit(0); } -void *thread_btm(void *data){ - unsigned int local_status = *(unsigned int*)data; - (void)local_status; +void *thread_btm(){ while(!(status & STATUS_QUIT_PROGRAM)){ pthread_mutex_lock(&mutex_btm); diff --git a/threading.h b/threading.h index 3c0da32..706ab7f 100644 --- a/threading.h +++ b/threading.h @@ -5,10 +5,10 @@ #include "threading.c" #endif -void *thread_lft(void *data); -void *thread_mid(void *data); -void *thread_rgt(void *data); -void *thread_top(void *data); -void *thread_btm(void *data); +void *thread_lft(); +void *thread_mid(); +void *thread_rgt(); +void *thread_top(); +void *thread_btm(); void threading_init(); void threading_free();