mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
internal/task: a few small correctness fixes
This shouldn't affect Linux or MacOS, but it's good to have them fixed.
This commit is contained in:
committed by
Ron Evans
parent
c6b47fe6a0
commit
93f40992c1
@@ -41,8 +41,7 @@ void tinygo_task_init(void *mainTask, pthread_t *thread, int *numCPU, void *cont
|
|||||||
// Register the "GC pause" signal for the entire process.
|
// Register the "GC pause" signal for the entire process.
|
||||||
// Using pthread_kill, we can still send the signal to a specific thread.
|
// Using pthread_kill, we can still send the signal to a specific thread.
|
||||||
struct sigaction act = { 0 };
|
struct sigaction act = { 0 };
|
||||||
act.sa_flags = SA_SIGINFO;
|
act.sa_handler = tinygo_task_gc_pause;
|
||||||
act.sa_handler = &tinygo_task_gc_pause;
|
|
||||||
sigaction(taskPauseSignal, &act, NULL);
|
sigaction(taskPauseSignal, &act, NULL);
|
||||||
|
|
||||||
// Obtain the number of CPUs available on program start (for NumCPU).
|
// Obtain the number of CPUs available on program start (for NumCPU).
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ func gcScanGlobals()
|
|||||||
var stackScanLock PMutex
|
var stackScanLock PMutex
|
||||||
|
|
||||||
//export tinygo_task_gc_pause
|
//export tinygo_task_gc_pause
|
||||||
func tingyo_task_gc_pause() {
|
func tingyo_task_gc_pause(sig int32) {
|
||||||
// Wait until we get the signal to start scanning the stack.
|
// Wait until we get the signal to start scanning the stack.
|
||||||
Current().state.gcSem.Wait()
|
Current().state.gcSem.Wait()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user