mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Fixes RDK_BUILD_THREADSAFE_SSS=OFF build (#4349)
* - fix non-threaded *nix builds that currently fail because boost flyweight introduces a dependency on pthreads - make sure that mutexes and futures are only used when RDK_BUILD_THREADSAFE_SSS is ON - fix SubstructMatch failing test when RDK_BUILD_THREADSAFE_SSS is OFF due to misplaced #ifdef's - rename RDK_TEST_MULTITHREADED to RDK_THREADSAFE_SSS in inchi.cpp (which is not a test) * - the limitexternal Linux build is now single-threaded so we make sure single-threaded builds do not break in the future (suggestion from Greg) * reverted unnecessary change to Code/GraphMol/FileParsers/testMultithreadedMolSupplier.cpp Co-authored-by: Paolo Tosco <paolo.tosco@novartis.com>
This commit is contained in:
6
External/YAeHMOP/EHTTools.cpp
vendored
6
External/YAeHMOP/EHTTools.cpp
vendored
@@ -4,7 +4,9 @@
|
||||
#include "EHTTools.h"
|
||||
#include <GraphMol/RDKitBase.h>
|
||||
#include <GraphMol/MolOps.h>
|
||||
#ifdef RDK_THREADSAFE_SSS
|
||||
#include <mutex>
|
||||
#endif
|
||||
#include <fstream>
|
||||
|
||||
extern "C" {
|
||||
@@ -19,11 +21,15 @@ const std::string _EHTChargeMatrix = "_EHTChargeMatrix";
|
||||
|
||||
// we should only call into the C code, which uses tons of globals, from one
|
||||
// thread at a time. This mutex enforces that.
|
||||
#ifdef RDK_THREADSAFE_SSS
|
||||
std::mutex yaehmop_mutex;
|
||||
#endif
|
||||
|
||||
bool runMol(const ROMol &mol, EHTResults &results, int confId,
|
||||
bool preserveHamiltonianAndOverlapMatrices) {
|
||||
#ifdef RDK_THREADSAFE_SSS
|
||||
std::lock_guard<std::mutex> lock(yaehmop_mutex);
|
||||
#endif
|
||||
|
||||
// -----------------------------
|
||||
// ----- BOILERPLATE -----------
|
||||
|
||||
Reference in New Issue
Block a user