about summary refs log tree commit diff stats
path: root/src/dynarec/dynablock.c
diff options
context:
space:
mode:
authorptitSeb <seebastien.chev@gmail.com>2023-09-09 16:26:50 +0200
committerptitSeb <seebastien.chev@gmail.com>2023-09-09 16:26:50 +0200
commite245dee90b431532fd6fb2296e66f4e03c17095c (patch)
treecb717fc97f3837ffd07b02141a1851bef51f1f66 /src/dynarec/dynablock.c
parentedba2a2e96ca446b22d9258f27250408db2eb949 (diff)
downloadbox64-e245dee90b431532fd6fb2296e66f4e03c17095c.tar.gz
box64-e245dee90b431532fd6fb2296e66f4e03c17095c.zip
[DYNAREC] Small improvment on multi-thread reliance for the jumptable
Diffstat (limited to 'src/dynarec/dynablock.c')
-rw-r--r--src/dynarec/dynablock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dynarec/dynablock.c b/src/dynarec/dynablock.c
index d95fb829..d6240191 100644
--- a/src/dynarec/dynablock.c
+++ b/src/dynarec/dynablock.c
@@ -41,10 +41,10 @@ dynablock_t* InvalidDynablock(dynablock_t* db, int need_lock)
         if(db->gone)
             return NULL; // already in the process of deletion!
         dynarec_log(LOG_DEBUG, "InvalidDynablock(%p), db->block=%p x64=%p:%p already gone=%d\n", db, db->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->gone);
+        // remove jumptable without waiting
+        setJumpTableDefault64(db->x64_addr);
         if(need_lock)
             mutex_lock(&my_context->mutex_dyndump);
-        // remove jumptable
-        setJumpTableDefault64(db->x64_addr);
         db->done = 0;
         db->gone = 1;
         if(need_lock)
@@ -74,10 +74,10 @@ void FreeDynablock(dynablock_t* db, int need_lock)
         if(db->gone)
             return; // already in the process of deletion!
         dynarec_log(LOG_DEBUG, "FreeDynablock(%p), db->block=%p x64=%p:%p already gone=%d\n", db, db->block, db->x64_addr, db->x64_addr+db->x64_size-1, db->gone);
+        // remove jumptable without waiting
+        setJumpTableDefault64(db->x64_addr);
         if(need_lock)
             mutex_lock(&my_context->mutex_dyndump);
-        // remove jumptable
-        setJumpTableDefault64(db->x64_addr);
         dynarec_log(LOG_DEBUG, " -- FreeDyrecMap(%p, %d)\n", db->actual_block, db->size);
         db->done = 0;
         db->gone = 1;