From 6a1b9e050a488cb5b2e1217fd3a01e484c3d7bb7 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 11 Nov 2021 20:47:10 +0100 Subject: [DYNAREC] Changed Dynarec a bit to try stabilise program using many threads and a JIT (help RimWorld Linux, but not enough to be 100% stable) --- src/libtools/signals.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libtools') diff --git a/src/libtools/signals.c b/src/libtools/signals.c index 2d3a8aed..3cb84d7d 100755 --- a/src/libtools/signals.c +++ b/src/libtools/signals.c @@ -705,6 +705,8 @@ void my_sigactionhandler_oldcode(int32_t sig, int simple, siginfo_t* info, void relockMutex(Locks); } +extern __thread void* current_helper; + void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx) { // sig==SIGSEGV || sig==SIGBUS || sig==SIGILL here! @@ -736,8 +738,10 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx) int Locks = unlockMutex(); uint32_t prot = getProtection((uintptr_t)addr); #ifdef DYNAREC - if((Locks & (1<<8)) && (sig==SIGSEGV)) //1<<8 is mutex_dyndump - cancelFillBlock(); // Segfault inside a Fillblock, just cancel it's creation, don't relock mutex + if((Locks & (1<<8)) && (sig==SIGSEGV) && current_helper) {//1<<8 is mutex_dyndump + relockMutex(Locks); + cancelFillBlock(); // Segfault inside a Fillblock, cancel it's creation... + } dynablock_t* db = NULL; int db_searched = 0; if ((sig==SIGSEGV) && (addr) && (info->si_code == SEGV_ACCERR) && (prot&PROT_DYNAREC)) { -- cgit 1.4.1