Signed-off-by: Ben Pfaff <blp@nicira.com>
#include "dynamic-string.h"
#include "hash.h"
#include "dynamic-string.h"
#include "hash.h"
#include "ovsdb-error.h"
#include "ovsdb-parser.h"
#include "json.h"
#include "ovsdb-error.h"
#include "ovsdb-parser.h"
#include "json.h"
ovsdb_atom_default(enum ovsdb_atomic_type type)
{
static union ovsdb_atom default_atoms[OVSDB_N_TYPES];
ovsdb_atom_default(enum ovsdb_atomic_type type)
{
static union ovsdb_atom default_atoms[OVSDB_N_TYPES];
+ static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
+ if (ovsthread_once_start(&once)) {
int i;
for (i = 0; i < OVSDB_N_TYPES; i++) {
int i;
for (i = 0; i < OVSDB_N_TYPES; i++) {
ovsdb_atom_init_default(&default_atoms[i], i);
}
}
ovsdb_atom_init_default(&default_atoms[i], i);
}
}
+ ovsthread_once_done(&once);
}
ovs_assert(ovsdb_atomic_type_is_valid(type));
}
ovs_assert(ovsdb_atomic_type_is_valid(type));