Commit 62face74 by Maarten L. Hekkelman

catch when another thread is still running

parent 3928be49
...@@ -1211,6 +1211,8 @@ DSSPImpl::DSSPImpl(const Structure& s, int min_poly_proline_stretch_length) ...@@ -1211,6 +1211,8 @@ DSSPImpl::DSSPImpl(const Structure& s, int min_poly_proline_stretch_length)
std::thread ta(std::bind(&CalculateAccessibilities, std::ref(mResidues), std::ref(mStats))); std::thread ta(std::bind(&CalculateAccessibilities, std::ref(mResidues), std::ref(mStats)));
try
{
auto& db = s.getFile().data(); auto& db = s.getFile().data();
for (auto r: db["struct_conn"].find(cif::Key("conn_type_id") == "disulf")) for (auto r: db["struct_conn"].find(cif::Key("conn_type_id") == "disulf"))
{ {
...@@ -1279,7 +1281,11 @@ DSSPImpl::DSSPImpl(const Structure& s, int min_poly_proline_stretch_length) ...@@ -1279,7 +1281,11 @@ DSSPImpl::DSSPImpl(const Structure& s, int min_poly_proline_stretch_length)
for (const auto& [a, b]: mSSBonds) for (const auto& [a, b]: mSSBonds)
{ {
if (a == b) if (a == b)
throw std::runtime_error("first and second residue are the same"); {
std::cerr << "In the SS bonds list, the residue " << a->mM << " is bonded to itself" << std::endl;
continue;
}
// throw std::runtime_error("first and second residue are the same");
if (a->mM.asymID() == b->mM.asymID() and NoChainBreak(a, b)) if (a->mM.asymID() == b->mM.asymID() and NoChainBreak(a, b))
++mStats.nrOfIntraChainSSBridges; ++mStats.nrOfIntraChainSSBridges;
...@@ -1303,6 +1309,12 @@ DSSPImpl::DSSPImpl(const Structure& s, int min_poly_proline_stretch_length) ...@@ -1303,6 +1309,12 @@ DSSPImpl::DSSPImpl(const Structure& s, int min_poly_proline_stretch_length)
} }
} }
} }
}
catch (const std::exception& ex)
{
ta.join();
throw;
}
ta.join(); ta.join();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment