From: Zachary Cook Date: Mon, 8 Jun 2020 01:29:45 +0000 (-0400) Subject: lightrec: fix race that could cause a freeze during load/reset X-Git-Tag: r24l~635^2 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea17432f22e441c9bf6f1c60f58a8cc6faaebbb1;p=pcsx_rearmed.git 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" --- diff --git a/deps/lightrec/.gitrepo b/deps/lightrec/.gitrepo index 0dbefe8e..4ebb7d2b 100644 --- a/deps/lightrec/.gitrepo +++ b/deps/lightrec/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/pcercuei/lightrec.git branch = master - commit = 2081869a00371dac285836fb950f8cd0c26b55b9 + commit = 2cca097e538876d219b8af9663abe0ca74f68bb2 parent = 5c00ea32a0eab812299b08acd14c25bf6ba4ca7a method = merge cmdver = 0.4.1 diff --git a/deps/lightrec/recompiler.c b/deps/lightrec/recompiler.c index e60889ce..634d3d01 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);