diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-11-11 20:47:10 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-11-11 20:47:10 +0100 |
| commit | 6a1b9e050a488cb5b2e1217fd3a01e484c3d7bb7 (patch) | |
| tree | ee38007ce576f32a13b6c8f9ec298002300d74ba /src/libtools | |
| parent | 6675b43dd0d7eb567227bea204ee663b1e7aab4a (diff) | |
| download | box64-6a1b9e050a488cb5b2e1217fd3a01e484c3d7bb7.tar.gz box64-6a1b9e050a488cb5b2e1217fd3a01e484c3d7bb7.zip | |
[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)
Diffstat (limited to 'src/libtools')
| -rwxr-xr-x | src/libtools/signals.c | 8 |
1 files changed, 6 insertions, 2 deletions
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)) { |