@@ -923,7 +923,7 @@ bool is_polymorphic_type_assignable(CheckerContext *c, Type *poly, Type *source,
poly->kind = Type_EnumeratedArray;
poly->cached_size = -1;
poly->cached_align = -1;
- poly->flags = source->flags;
+ poly->flags.exchange(source->flags);
poly->failure = false;
poly->EnumeratedArray.elem = source->EnumeratedArray.elem;
poly->EnumeratedArray.index = source->EnumeratedArray.index;
@@ -115,8 +115,8 @@ enum ProcedureOptimizationMode : u32 {
struct Entity {
EntityKind kind;
u64 id;
- u64 flags;
- EntityState state;
+ std::atomic<u64> flags;
+ std::atomic<EntityState> state;
Token token;
Scope * scope;
Type * type;
@@ -306,9 +306,9 @@ struct Type {
};
// NOTE(bill): These need to be at the end to not affect the unionized data
- i64 cached_size;
- i64 cached_align;
- u32 flags; // TypeFlag
+ std::atomic<i64> cached_size;
+ std::atomic<i64> cached_align;
+ std::atomic<u32> flags; // TypeFlag
bool failure;