I have a variable that I intend to use in multiple files, is a mutex initializer.
So I wrote in one header file this :
#ifndef LISTEN_H_
#define LISTEN_H_
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
I tried to include the header in the files in witch I intend to use the variable.
But i get : error mutex has already been declared here.
What is the proper way to use a global variable in multiple header files ?