fix threadboth

This commit is contained in:
quentin.perret 2022-06-15 17:50:47 +02:00
parent d6f1fc5cfa
commit 7af7366247
2 changed files with 3 additions and 6 deletions

View file

@ -53,8 +53,6 @@ void *threadCalculBoth(void *vargp){
char* fileName; char* fileName;
while(rawDataWriteFlag){ while(rawDataWriteFlag){
while(queueGetNextE(rawDataQueue) != NULL){ while(queueGetNextE(rawDataQueue) != NULL){
printf("ertyu\n");
rawDataQueue = queueGetNextE(rawDataQueue); rawDataQueue = queueGetNextE(rawDataQueue);
fileName = queueGetTabChar(rawDataQueue); fileName = queueGetTabChar(rawDataQueue);
powerFunction(fileName, NULL); powerFunction(fileName, NULL);
@ -114,7 +112,7 @@ int main(int argc , char** argv){
pthread_t rawData; pthread_t rawData;
pthread_create(&rawData , NULL, threadSimulateFlux, (void *)&rawData); pthread_create(&rawData , NULL, threadSimulateFlux, (void *)&rawData);
pthread_t calcul; pthread_t calcul;
pthread_create(&calcul , NULL, threadCalculBoth, (void *)&calcul); pthread_create(&calcul , NULL, threadCalculGrowthRate, (void *)&calcul);
pthread_exit(NULL); pthread_exit(NULL);
} }

View file

@ -36,12 +36,11 @@ void powerFunction(char* rawDataFileName, double **pw){
if(p !=NULL){ if(p !=NULL){
if(pw == NULL){ if(pw == NULL){
powerCalculation(p,pww); powerCalculation(p,pww);
appendDataInFile("powerData.csv",pww,nCol-1);
}else{ }else{
powerCalculation(p,*pw); powerCalculation(p,*pw);
appendDataInFile("powerData.csv",*pw,nCol-1);
} }
appendDataInFile("powerData.csv",*pw,nCol-1);
freeArray(p,nRow); freeArray(p,nRow);
} }
} }