aboutsummaryrefslogtreecommitdiff
path: root/deps/lightrec/recompiler.c
diff options
context:
space:
mode:
authorZachary Cook2020-06-07 21:29:45 -0400
committerZachary Cook2020-06-07 21:30:12 -0400
commitea17432f22e441c9bf6f1c60f58a8cc6faaebbb1 (patch)
tree583ff29a40f4594b9579a3ac3c346adf469e652c /deps/lightrec/recompiler.c
parentba5205015c1db5866b6979537c594d8e81f90500 (diff)
downloadpcsx_rearmed-ea17432f22e441c9bf6f1c60f58a8cc6faaebbb1.tar.gz
pcsx_rearmed-ea17432f22e441c9bf6f1c60f58a8cc6faaebbb1.tar.bz2
pcsx_rearmed-ea17432f22e441c9bf6f1c60f58a8cc6faaebbb1.zip
lightrec: fix race that could cause a freeze during load/reset
Issue #387 git subrepo commit (merge) deps/lightrec subrepo: subdir: "deps/lightrec" merged: "a3a7bf4" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "2cca097" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2"
Diffstat (limited to 'deps/lightrec/recompiler.c')
-rw-r--r--deps/lightrec/recompiler.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/deps/lightrec/recompiler.c b/deps/lightrec/recompiler.c
index e60889c..634d3d0 100644
--- a/deps/lightrec/recompiler.c
+++ b/deps/lightrec/recompiler.c
@@ -76,7 +76,7 @@ static void * lightrec_recompiler_thd(void *d)
pthread_mutex_lock(&rec->mutex);
- do {
+ while (!rec->stop) {
do {
pthread_cond_wait(&rec->cond, &rec->mutex);
@@ -86,7 +86,7 @@ static void * lightrec_recompiler_thd(void *d)
} while (slist_empty(&rec->slist));
lightrec_compile_list(rec);
- } while (!rec->stop);
+ }
out_unlock:
pthread_mutex_unlock(&rec->mutex);