Files
progettoso/src/serverWorker.h

22 lines
667 B
C
Raw Normal View History

2022-03-18 20:49:28 +01:00
#pragma once
#ifndef SERVERWORKER
#define SERVERWORKER
2022-03-18 20:49:28 +01:00
#include <apiFile.h>
#include <fileQueue.h>
// struttura dati che contiene gli argomenti da passare ai worker threads
typedef struct struct_thread {
long *args;
queueT *q; // puntatore alla queue dei file
// logT *logFileT; // puntatore alla struct del file di log
threadpool_t *pool; // puntatore alla threadpool
pthread_mutex_t *lock;
waitingT **waiting; // puntatore ai client in attesa di ottenere la lock su un file
} threadT;
// funzione eseguita dal generico Worker del pool di thread
void threadF(void *arg);
#endif /* SERVERWORKER */