diff --git a/daemon/Child.cpp b/daemon/Child.cpp
index c0540762698fc3c87eaa7fc2443eb39a3ad16600..9ee2ef8afb9d582225cb0823151758138e9b119c 100644 (file)
--- a/daemon/Child.cpp
+++ b/daemon/Child.cpp
}
}
-static void* durationThread(void* pVoid) {
+static void *durationThread(void *) {
prctl(PR_SET_NAME, (unsigned long)&"gatord-duration", 0, 0, 0);
sem_wait(&startProfile);
if (gSessionData->mSessionIsActive) {
return 0;
}
-static void* stopThread(void* pVoid) {
+static void *stopThread(void *) {
OlySocket* socket = child->socket;
prctl(PR_SET_NAME, (unsigned long)&"gatord-stopper", 0, 0, 0);
return 0;
}
-void* countersThread(void* pVoid) {
+static void *countersThread(void *) {
prctl(PR_SET_NAME, (unsigned long)&"gatord-counters", 0, 0, 0);
gSessionData->hwmon.start();
return NULL;
}
-static void* senderThread(void* pVoid) {
+static void *senderThread(void *) {
int length = 1;
char* data;
char end_sequence[] = {RESPONSE_APC_DATA, 0, 0, 0, 0};
thread_creation_success = false;
}
- if (gSessionData->hwmon.countersEnabled()) {
+ bool startcountersThread = gSessionData->hwmon.countersEnabled();
+ if (startcountersThread) {
if (pthread_create(&countersThreadID, NULL, countersThread, this)) {
thread_creation_success = false;
}
} while (bytesCollected > 0);
logg->logMessage("Exit collect data loop");
- if (gSessionData->hwmon.countersEnabled()) {
+ if (startcountersThread) {
pthread_join(countersThreadID, NULL);
}