Description:
when using:
mutex = PTHREAD_MUTEX_INITIALIZER;
instead of:
pthread_mutex_init(&mutex, NULL);
There could be warning on some environments:
store_mngr.c:31:10: warning: extended initializer lists only available
with -std=c++11 or -std=gnu++11 [enabled by default]
mutex = PTHREAD_MUTEX_INITIALIZER;
To get rid of it, simply use the init/destroy mutex helpers.
list_str = get_pool_memory(PM_MESSAGE);
*source = 0;
store = NULL;
- mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_init(&mutex, NULL);
}
storage::~storage() {
if (list_str) {
free_and_null_pool_memory(list_str);
}
+
+ pthread_mutex_destroy(&mutex);
}
void storage::set_rw(bool write) {