Skip to content

Commit

Permalink
Modernisation: Action: Fix data race
Browse files Browse the repository at this point in the history
  • Loading branch information
joobog committed Jan 13, 2025
1 parent c11bb6a commit dd2875f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/action/action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ static void init_mutex()
int grib_create_accessor(grib_section* p, grib_action* a, grib_loader* h)
{
/* ECC-604: Do not lock excessively */
/*GRIB_MUTEX_INIT_ONCE(&once,&init_mutex);*/
/*GRIB_MUTEX_LOCK(&mutex1);*/
return a->create_accessor(p, h);
/*GRIB_MUTEX_UNLOCK(&mutex1);*/
GRIB_MUTEX_INIT_ONCE(&once,&init_mutex);
GRIB_MUTEX_LOCK(&mutex1);
auto accessor = a->create_accessor(p, h);
GRIB_MUTEX_UNLOCK(&mutex1);
return accessor;
}

// int grib_action_notify_change(grib_action* a, grib_accessor* observer, grib_accessor* observed)
Expand Down

0 comments on commit dd2875f

Please sign in to comment.