diff --git a/src/action_class_concept.cc b/src/action_class_concept.cc index bbb8f9638..74fb25588 100644 --- a/src/action_class_concept.cc +++ b/src/action_class_concept.cc @@ -306,7 +306,7 @@ static grib_concept_value* get_concept_impl(grib_handle* h, grib_action_concept* static grib_concept_value* get_concept(grib_handle* h, grib_action_concept* self) { grib_concept_value* result = NULL; - GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); result = get_concept_impl(h, self); diff --git a/src/grib_accessor_class_smart_table.cc b/src/grib_accessor_class_smart_table.cc index 0e5653cc2..e16ebc490 100644 --- a/src/grib_accessor_class_smart_table.cc +++ b/src/grib_accessor_class_smart_table.cc @@ -306,10 +306,10 @@ 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_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &thread_init); + GRIB_MUTEX_LOCK(&mutex); c->smart_table = t; - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); } else if (t->filename[1] == NULL) { t->filename[1] = grib_context_strdup_persistent(c, filename); diff --git a/src/grib_ibmfloat.cc b/src/grib_ibmfloat.cc index 1b11ed3bf..d8dc76206 100644 --- a/src/grib_ibmfloat.cc +++ b/src/grib_ibmfloat.cc @@ -80,13 +80,13 @@ static void init_ibm_table() static void init_table_if_needed() { - GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); if (!ibm_table.inited) init_ibm_table(); - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); } static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j) diff --git a/src/grib_ieeefloat.cc b/src/grib_ieeefloat.cc index 5ed74163a..642227fe2 100644 --- a/src/grib_ieeefloat.cc +++ b/src/grib_ieeefloat.cc @@ -10,7 +10,6 @@ /*************************************************************************** * Enrico Fucile - 06.01.2009 * - * * ***************************************************************************/ #include "grib_ieeefloat.h" @@ -86,13 +85,13 @@ static void init_ieee_table() static void init_table_if_needed() { - GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); if (!ieee_table.inited) init_ieee_table(); - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); } static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j) diff --git a/src/grib_itrie.cc b/src/grib_itrie.cc index b6c0dc105..0421e4b84 100644 --- a/src/grib_itrie.cc +++ b/src/grib_itrie.cc @@ -319,7 +319,7 @@ grib_itrie* grib_itrie_new(grib_context* c, int* count) void grib_itrie_delete(grib_itrie* t) { - GRIB_MUTEX_INIT_ONCE(&once, &init) + GRIB_MUTEX_INIT_ONCE(&once, &init); GRIB_MUTEX_LOCK(&mutex); if (t) { diff --git a/src/grib_memory.cc b/src/grib_memory.cc index f32bede58..5eebf7965 100644 --- a/src/grib_memory.cc +++ b/src/grib_memory.cc @@ -108,8 +108,8 @@ static void* fast_new(size_t s, mempool* pool) char* p; memblk* m; - GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); m = (memblk*)pool->priv; @@ -141,7 +141,7 @@ static void* fast_new(size_t s, mempool* pool) p = (memblk*)(pool->clear ? calloc(size, 1) : malloc(size)); if (!p) { - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); return NULL; } @@ -156,7 +156,7 @@ static void* fast_new(size_t s, mempool* pool) m->left -= s; m->cnt++; - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); return p; } @@ -167,8 +167,8 @@ static void fast_delete(void* p, mempool* pool) memblk* m; memblk* n = NULL; - GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); m = (memblk*)pool->priv; @@ -183,7 +183,7 @@ static void fast_delete(void* p, mempool* pool) pool->priv = (void*)m->next; free((void*)m); } - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); return; } @@ -271,8 +271,8 @@ void* grib_buffer_malloc(const grib_context* c, size_t s) { memblk* r; - GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); s = ((s + WORD - 1) / WORD) * WORD; r = reserve; @@ -297,7 +297,7 @@ void* grib_buffer_malloc(const grib_context* c, size_t s) r->size = s; r->cnt = 1; - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); return &r->buffer[0]; } @@ -307,8 +307,8 @@ void grib_buffer_free(const grib_context* c, void* p) memblk* r; memblk* s; - GRIB_MUTEX_INIT_ONCE(&once, &init) - GRIB_MUTEX_LOCK(&mutex) + GRIB_MUTEX_INIT_ONCE(&once, &init); + GRIB_MUTEX_LOCK(&mutex); r = (memblk*)(((char*)p) - HEADER_SIZE); s = reserve; @@ -320,7 +320,7 @@ void grib_buffer_free(const grib_context* c, void* p) s->cnt = 0; } - GRIB_MUTEX_UNLOCK(&mutex) + GRIB_MUTEX_UNLOCK(&mutex); } void* grib_buffer_realloc(const grib_context* c, void* p, size_t s) diff --git a/src/grib_parse_utils.cc b/src/grib_parse_utils.cc index a3eb1422b..04beecb51 100644 --- a/src/grib_parse_utils.cc +++ b/src/grib_parse_utils.cc @@ -752,12 +752,12 @@ static grib_action* grib_parse_stream(grib_context* gc, const char* filename) if (parse(gc, filename) == 0) { if (grib_parser_all_actions) { - GRIB_MUTEX_UNLOCK(&mutex_stream) + GRIB_MUTEX_UNLOCK(&mutex_stream); return grib_parser_all_actions; } else { grib_action* ret = grib_action_create_noop(gc, filename); - GRIB_MUTEX_UNLOCK(&mutex_stream) + GRIB_MUTEX_UNLOCK(&mutex_stream); return ret; } }