mirror of
https://gittea.dev/nova/th.git
synced 2025-10-21 10:20:15 -04:00
Compare commits
2 Commits
5afabfb412
...
c923497f01
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c923497f01 | ||
![]() |
69f9a609e5 |
@@ -28,8 +28,8 @@ int sort_natural(const void *file0_, const void *file1_){
|
|||||||
file *file0 = (file*)file0_;
|
file *file0 = (file*)file0_;
|
||||||
file *file1 = (file*)file1_;
|
file *file1 = (file*)file1_;
|
||||||
|
|
||||||
unsigned char *a = file0->file_name;
|
unsigned char *a = (unsigned char*)file0->file_name;
|
||||||
unsigned char *b = file1->file_name;
|
unsigned char *b = (unsigned char*)file1->file_name;
|
||||||
|
|
||||||
if (file0->file_type & (FILE_TYPE_SYMLINK | FILE_TYPE_DIR) && !(file1->file_type & (FILE_TYPE_SYMLINK | FILE_TYPE_DIR))) {
|
if (file0->file_type & (FILE_TYPE_SYMLINK | FILE_TYPE_DIR) && !(file1->file_type & (FILE_TYPE_SYMLINK | FILE_TYPE_DIR))) {
|
||||||
return -1;
|
return -1;
|
||||||
|
19
threading.c
19
threading.c
@@ -47,7 +47,7 @@ extern unsigned int terminal_width;
|
|||||||
extern unsigned int status;
|
extern unsigned int status;
|
||||||
|
|
||||||
|
|
||||||
void *thread_mid(void *data){
|
void *thread_mid(){
|
||||||
|
|
||||||
while(!(status & STATUS_QUIT_PROGRAM)){
|
while(!(status & STATUS_QUIT_PROGRAM)){
|
||||||
pthread_mutex_lock(&mutex_mid);
|
pthread_mutex_lock(&mutex_mid);
|
||||||
@@ -99,8 +99,7 @@ void *thread_mid(void *data){
|
|||||||
}
|
}
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
}
|
}
|
||||||
void *thread_lft(void *data){
|
void *thread_lft(){
|
||||||
unsigned int local_status = *(unsigned int*)data;
|
|
||||||
|
|
||||||
while(!(status & STATUS_QUIT_PROGRAM)){
|
while(!(status & STATUS_QUIT_PROGRAM)){
|
||||||
pthread_mutex_lock(&mutex_lft);
|
pthread_mutex_lock(&mutex_lft);
|
||||||
@@ -116,7 +115,7 @@ void *thread_lft(void *data){
|
|||||||
path[strrchr(path, '/')-path] = '\0';
|
path[strrchr(path, '/')-path] = '\0';
|
||||||
path[0] = '/';
|
path[0] = '/';
|
||||||
|
|
||||||
if (local_status & STATUS_RELOAD_DIRECTORY) {
|
if (status & STATUS_RELOAD_DIRECTORY) {
|
||||||
lft_file_count = get_dir_size(path);
|
lft_file_count = get_dir_size(path);
|
||||||
free(lft_content);
|
free(lft_content);
|
||||||
lft_content = malloc(lft_file_count * sizeof(file));
|
lft_content = malloc(lft_file_count * sizeof(file));
|
||||||
@@ -132,9 +131,7 @@ void *thread_lft(void *data){
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void *thread_rgt(void *data){
|
void *thread_rgt(){
|
||||||
unsigned int local_status = *(unsigned int*)data;
|
|
||||||
(void)local_status;
|
|
||||||
|
|
||||||
file file_current;
|
file file_current;
|
||||||
while(!(status & STATUS_QUIT_PROGRAM)){
|
while(!(status & STATUS_QUIT_PROGRAM)){
|
||||||
@@ -216,9 +213,7 @@ void *thread_rgt(void *data){
|
|||||||
}
|
}
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
}
|
}
|
||||||
void *thread_top(void *data){
|
void *thread_top(){
|
||||||
unsigned int local_status = *(unsigned int*)data;
|
|
||||||
(void)local_status;
|
|
||||||
|
|
||||||
while(!(status & STATUS_QUIT_PROGRAM)){
|
while(!(status & STATUS_QUIT_PROGRAM)){
|
||||||
pthread_mutex_lock(&mutex_top);
|
pthread_mutex_lock(&mutex_top);
|
||||||
@@ -241,9 +236,7 @@ void *thread_top(void *data){
|
|||||||
}
|
}
|
||||||
pthread_exit(0);
|
pthread_exit(0);
|
||||||
}
|
}
|
||||||
void *thread_btm(void *data){
|
void *thread_btm(){
|
||||||
unsigned int local_status = *(unsigned int*)data;
|
|
||||||
(void)local_status;
|
|
||||||
|
|
||||||
while(!(status & STATUS_QUIT_PROGRAM)){
|
while(!(status & STATUS_QUIT_PROGRAM)){
|
||||||
pthread_mutex_lock(&mutex_btm);
|
pthread_mutex_lock(&mutex_btm);
|
||||||
|
10
threading.h
10
threading.h
@@ -5,10 +5,10 @@
|
|||||||
#include "threading.c"
|
#include "threading.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void *thread_lft(void *data);
|
void *thread_lft();
|
||||||
void *thread_mid(void *data);
|
void *thread_mid();
|
||||||
void *thread_rgt(void *data);
|
void *thread_rgt();
|
||||||
void *thread_top(void *data);
|
void *thread_top();
|
||||||
void *thread_btm(void *data);
|
void *thread_btm();
|
||||||
void threading_init();
|
void threading_init();
|
||||||
void threading_free();
|
void threading_free();
|
||||||
|
Reference in New Issue
Block a user