mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix race condition; Change for in addressing mode
This commit is contained in:
+2
-1
@@ -1472,8 +1472,9 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
|
|||||||
found = scope_lookup_current(ctx->scope, str);
|
found = scope_lookup_current(ctx->scope, str);
|
||||||
}
|
}
|
||||||
if (found == nullptr) {
|
if (found == nullptr) {
|
||||||
bool is_immutable = true;
|
bool is_immutable = false;
|
||||||
entity = alloc_entity_variable(ctx->scope, token, type, is_immutable, EntityState_Resolved);
|
entity = alloc_entity_variable(ctx->scope, token, type, is_immutable, EntityState_Resolved);
|
||||||
|
entity->flags |= EntityFlag_Value;
|
||||||
add_entity_definition(&ctx->checker->info, name, entity);
|
add_entity_definition(&ctx->checker->info, name, entity);
|
||||||
} else {
|
} else {
|
||||||
TokenPos pos = found->token.pos;
|
TokenPos pos = found->token.pos;
|
||||||
|
|||||||
+1
-1
@@ -4702,6 +4702,7 @@ gb_inline void gb_thread_start_with_stack(gbThread *t, gbThreadProc *proc, void
|
|||||||
t->proc = proc;
|
t->proc = proc;
|
||||||
t->user_data = user_data;
|
t->user_data = user_data;
|
||||||
t->stack_size = stack_size;
|
t->stack_size = stack_size;
|
||||||
|
t->is_running = true;
|
||||||
|
|
||||||
#if defined(GB_SYSTEM_WINDOWS)
|
#if defined(GB_SYSTEM_WINDOWS)
|
||||||
t->win32_handle = CreateThread(NULL, stack_size, gb__thread_proc, t, 0, NULL);
|
t->win32_handle = CreateThread(NULL, stack_size, gb__thread_proc, t, 0, NULL);
|
||||||
@@ -4719,7 +4720,6 @@ gb_inline void gb_thread_start_with_stack(gbThread *t, gbThreadProc *proc, void
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
t->is_running = true;
|
|
||||||
gb_semaphore_wait(&t->semaphore);
|
gb_semaphore_wait(&t->semaphore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user