4d346d3735
Including * Support thread state switching in codegen * Introduce and use GCUnsafeCall annotation * Switch thread state in C++ runtime code Also * Register current thread in Mark&Sweep tests * Store MemoryState in Worker instance * Set worker tid in WorkerInit
20 lines
307 B
Modula-2
20 lines
307 B
Modula-2
language = C
|
|
|
|
---
|
|
|
|
#include <stdint.h>
|
|
|
|
void assertNativeThreadState();
|
|
|
|
void runCallback(void(*callback)(void)) {
|
|
assertNativeThreadState();
|
|
callback();
|
|
assertNativeThreadState();
|
|
}
|
|
|
|
int32_t answer() {
|
|
assertNativeThreadState();
|
|
return 42;
|
|
}
|
|
|
|
void runInNewThread(void(*callback)(void)); |