lua-bson atomic
@@ -1245,11 +1245,11 @@ typeclosure(lua_State *L) {
}
static uint8_t oid_header[5];
-static uint32_t oid_counter;
+static ATOM_ULONG oid_counter;
static void
init_oid_header() {
- if (oid_counter) {
+ if (ATOM_LOAD(&oid_counter)) {
// already init
return;
}
@@ -1273,7 +1273,7 @@ init_oid_header() {
if (c == 0) {
c = 1;
}
- oid_counter = c;
+ ATOM_STORE(&oid_counter, c);
}
static inline int
