#load "core/intrinsics/wasm"
#if runtime.Multi_Threading_Enabled {
- heap_mutex: sync.Mutex;
+ sync :: package core.sync
+
+ heap_mutex: sync.Mutex
}
init :: () {
memory :: package core.memory
math :: package core.math
runtime :: package runtime
- sync :: package core.sync
uintptr :: #type u32
heap_resize :: (ptr: rawptr, new_size_: u32, align: u32) -> rawptr {
if ptr == null do return null;
-
+
#if runtime.Multi_Threading_Enabled {
sync.scoped_mutex(^heap_mutex);
}
[X] Change initialization process for main thread / worker threads
- _thread_start
[X] Write the JS glue code that will ship with the multi-threaded binary
- [ ] Write basic threading primatives like mutex and semaphore
- [ ] Make heap and printf take a mutex
+ [X] Write basic threading primatives like mutex and semaphore
+ [X] Make heap and printf take a mutex
[ ] LATER: add thread-local variables
- Have a new global that is the TLS base pointer