Files
fastfetch/src/common/threading.c
T

76 lines
1.8 KiB
C
Raw Normal View History

2021-04-09 14:07:05 +02:00
#include "fastfetch.h"
#include <pthread.h>
2021-04-28 19:53:30 +02:00
static inline void* detectPlasmaThreadMain(void* instance)
2021-04-09 14:07:05 +02:00
{
2021-04-28 19:53:30 +02:00
ffDetectPlasma((FFinstance*)instance);
2021-04-09 14:07:05 +02:00
return NULL;
}
2021-04-28 19:53:30 +02:00
static inline void* detectGTK2ThreadMain(void* instance)
2021-04-09 14:07:05 +02:00
{
2021-04-28 19:53:30 +02:00
ffDetectGTK2((FFinstance*)instance);
2021-04-09 14:07:05 +02:00
return NULL;
}
2021-04-28 19:53:30 +02:00
static inline void* detectGTK3ThreadMain(void* instance)
2021-04-09 14:07:05 +02:00
{
2021-04-28 19:53:30 +02:00
ffDetectGTK3((FFinstance*)instance);
2021-04-09 14:07:05 +02:00
return NULL;
}
2021-04-28 19:53:30 +02:00
static inline void* detectGTK4ThreadMain(void* instance)
2021-04-09 14:07:05 +02:00
{
2021-04-28 19:53:30 +02:00
ffDetectGTK4((FFinstance*)instance);
2021-04-09 14:07:05 +02:00
return NULL;
}
2021-05-01 13:03:30 +02:00
static inline void* detectWMDEThreadMain(void* instance)
2021-04-09 14:07:05 +02:00
{
2021-05-01 13:03:30 +02:00
ffDetectWMDE((FFinstance*)instance);
2021-04-09 14:07:05 +02:00
return NULL;
}
2021-04-28 19:53:30 +02:00
static inline void* detectTerminalThreadMain(void* instance)
2021-04-09 14:07:05 +02:00
{
2021-04-28 19:53:30 +02:00
ffDetectTerminal((FFinstance*)instance);
2021-04-09 14:07:05 +02:00
return NULL;
}
static inline void* startThreadsThreadMain(void* instance)
{
2021-05-01 13:03:30 +02:00
pthread_t wmdeThread;
pthread_create(&wmdeThread, NULL, detectWMDEThreadMain, instance);
pthread_detach(wmdeThread);
2021-04-09 14:07:05 +02:00
pthread_t gtk2Thread;
2021-04-28 19:53:30 +02:00
pthread_create(&gtk2Thread, NULL, detectGTK2ThreadMain, instance);
2021-04-09 14:07:05 +02:00
pthread_detach(gtk2Thread);
pthread_t gtk3Thread;
2021-04-28 19:53:30 +02:00
pthread_create(&gtk3Thread, NULL, detectGTK3ThreadMain, instance);
2021-04-09 14:07:05 +02:00
pthread_detach(gtk3Thread);
pthread_t gtk4Thread;
2021-04-28 19:53:30 +02:00
pthread_create(&gtk4Thread, NULL, detectGTK4ThreadMain, instance);
2021-04-09 14:07:05 +02:00
pthread_detach(gtk4Thread);
pthread_t terminalThread;
2021-04-28 19:53:30 +02:00
pthread_create(&terminalThread, NULL, detectTerminalThreadMain, instance);
2021-04-09 14:07:05 +02:00
pthread_detach(terminalThread);
pthread_t plasmaThread;
2021-04-28 19:53:30 +02:00
pthread_create(&plasmaThread, NULL, detectPlasmaThreadMain, instance);
2021-04-09 14:07:05 +02:00
pthread_detach(plasmaThread);
return NULL;
}
void ffStartCalculationThreads(FFinstance* instance)
{
pthread_t startThreadsThread;
pthread_create(&startThreadsThread, NULL, startThreadsThreadMain, instance);
pthread_detach(startThreadsThread);
}