diff --git a/src/accessor/grib_accessor_class_bufr_elements_table.cc b/src/accessor/grib_accessor_class_bufr_elements_table.cc index ddd055544..3ccf5e306 100644 --- a/src/accessor/grib_accessor_class_bufr_elements_table.cc +++ b/src/accessor/grib_accessor_class_bufr_elements_table.cc @@ -16,7 +16,7 @@ static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -static void thread_init() +static void init_mutex() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -28,7 +28,7 @@ static void thread_init() static int once = 0; static omp_nest_lock_t mutex1; -void thread_init() +static void init_mutex() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_bufr_elements_table_c) { @@ -90,7 +90,7 @@ static grib_trie* load_bufr_elements_table(grib_accessor* a, int* err) if (self->localDir != NULL) grib_get_string(h, self->localDir, localDir, &len); - GRIB_MUTEX_INIT_ONCE(&once, &thread_init); + GRIB_MUTEX_INIT_ONCE(&once, &init_mutex); GRIB_MUTEX_LOCK(&mutex1); if (*masterDir != 0) { diff --git a/src/accessor/grib_accessor_class_codetable.cc b/src/accessor/grib_accessor_class_codetable.cc index f21ef0f86..9a9df9040 100644 --- a/src/accessor/grib_accessor_class_codetable.cc +++ b/src/accessor/grib_accessor_class_codetable.cc @@ -20,7 +20,7 @@ grib_accessor_class* grib_accessor_class_codetable = &_grib_accessor_class_codet static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; -void thread_init() +static void init_mutex() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -32,7 +32,7 @@ void thread_init() static int once = 0; static omp_nest_lock_t mutex1; -void thread_init() +static void init_mutex() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_codetable_c) { @@ -205,7 +205,7 @@ static grib_codetable* load_table(grib_accessor* a) localFilename = grib_context_full_defs_path(c, localRecomposed); } - GRIB_MUTEX_INIT_ONCE(&once, &thread_init); + GRIB_MUTEX_INIT_ONCE(&once, &init_mutex); GRIB_MUTEX_LOCK(&mutex1); /* GRIB-930 */ /*printf("DBG %s: Look in cache: f=%s lf=%s (recomposed=%s)\n", self->att.name, filename, localFilename,recomposed);*/ diff --git a/src/accessor/grib_accessor_class_smart_table.cc b/src/accessor/grib_accessor_class_smart_table.cc index 1c49f2ab0..8be64d9d5 100644 --- a/src/accessor/grib_accessor_class_smart_table.cc +++ b/src/accessor/grib_accessor_class_smart_table.cc @@ -18,7 +18,7 @@ grib_accessor_class* grib_accessor_class_smart_table = &_grib_accessor_class_sma static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static void thread_init() +static void init_mutex() { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -30,7 +30,7 @@ static void thread_init() static int once = 0; static omp_nest_lock_t mutex; -void thread_init() +static void init_mutex() { GRIB_OMP_CRITICAL(lock_grib_accessor_class_smart_table_c) { @@ -183,7 +183,7 @@ static int grib_load_smart_table(grib_context* c, const char* filename, t->recomposed_name[0] = grib_context_strdup_persistent(c, recomposed_name); t->next = c->smart_table; t->numberOfEntries = size; - GRIB_MUTEX_INIT_ONCE(&once, &thread_init); + GRIB_MUTEX_INIT_ONCE(&once, &init_mutex); GRIB_MUTEX_LOCK(&mutex); c->smart_table = t; GRIB_MUTEX_UNLOCK(&mutex);