From 7a40d6c03012bde4e06d65b92bf06ccab2b73d93 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 12 Oct 2016 16:18:51 -0400 Subject: Fix mutex in oids.cpp Remove bogus includes for TLS tests --- src/lib/asn1/oid_lookup/oids.cpp | 14 +++++++------- src/tests/unit_tls.cpp | 1 - src/tests/unit_tls_policy.cpp | 1 - 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/lib/asn1/oid_lookup/oids.cpp b/src/lib/asn1/oid_lookup/oids.cpp index f49a3daf3..8ee10b75a 100644 --- a/src/lib/asn1/oid_lookup/oids.cpp +++ b/src/lib/asn1/oid_lookup/oids.cpp @@ -27,7 +27,7 @@ class OID_Map void add_str2oid(const OID& oid, const std::string& str) { - std::lock_guard lock(m_mutex); + lock_guard_type lock(m_mutex); auto i = m_str2oid.find(str); if(i == m_str2oid.end()) m_str2oid.insert(std::make_pair(str, oid)); @@ -35,7 +35,7 @@ class OID_Map void add_oid2str(const OID& oid, const std::string& str) { - std::lock_guard lock(m_mutex); + lock_guard_type lock(m_mutex); auto i = m_oid2str.find(oid); if(i == m_oid2str.end()) m_oid2str.insert(std::make_pair(oid, str)); @@ -43,7 +43,7 @@ class OID_Map std::string lookup(const OID& oid) { - std::lock_guard lock(m_mutex); + lock_guard_type lock(m_mutex); auto i = m_oid2str.find(oid); if(i != m_oid2str.end()) @@ -54,7 +54,7 @@ class OID_Map OID lookup(const std::string& str) { - std::lock_guard lock(m_mutex); + lock_guard_type lock(m_mutex); auto i = m_str2oid.find(str); if(i != m_str2oid.end()) @@ -72,7 +72,7 @@ class OID_Map bool have_oid(const std::string& str) { - std::lock_guard lock(m_mutex); + lock_guard_type lock(m_mutex); return m_str2oid.find(str) != m_str2oid.end(); } @@ -92,14 +92,14 @@ class OID_Map read_cfg(cfg, "builtin"); } - std::mutex m_mutex; + mutex_type m_mutex; std::map m_str2oid; std::map m_oid2str; }; void OID_Map::read_cfg(std::istream& cfg, const std::string& source) { - std::lock_guard lock(m_mutex); + lock_guard_type lock(m_mutex); size_t line = 0; diff --git a/src/tests/unit_tls.cpp b/src/tests/unit_tls.cpp index 28abe2d42..0dae9bec5 100644 --- a/src/tests/unit_tls.cpp +++ b/src/tests/unit_tls.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #endif diff --git a/src/tests/unit_tls_policy.cpp b/src/tests/unit_tls_policy.cpp index 2e5b63f41..95290b933 100644 --- a/src/tests/unit_tls_policy.cpp +++ b/src/tests/unit_tls_policy.cpp @@ -10,7 +10,6 @@ #if defined(BOTAN_HAS_TLS) #include - #include #include #include #endif -- cgit v1.2.3