fix: Various pattern execution race conditions

This commit is contained in:
WerWolv
2023-05-12 15:46:13 +02:00
parent 0a7a190b04
commit aaeebd3fe9
5 changed files with 45 additions and 40 deletions

View File

@@ -272,7 +272,7 @@ namespace hex {
* @brief Provides access to the current provider's pattern language runtime's lock
* @return Lock
*/
std::scoped_lock<std::mutex> getRuntimeLock();
std::mutex& getRuntimeLock();
/**
* @brief Configures the pattern language runtime using ImHex's default settings

View File

@@ -265,10 +265,10 @@ namespace hex {
return *runtime;
}
std::scoped_lock<std::mutex> getRuntimeLock() {
std::mutex& getRuntimeLock() {
static std::mutex runtimeLock;
return std::scoped_lock(runtimeLock);
return runtimeLock;
}
void configureRuntime(pl::PatternLanguage &runtime, prv::Provider *provider) {