diff options
author | lloyd <[email protected]> | 2009-04-01 15:43:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-04-01 15:43:27 +0000 |
commit | 99e8c1a20700631103ec20386f8080eeee4df588 (patch) | |
tree | bc3ecc536cb98a39c2707dc8eba08e3a648a5c45 | |
parent | 855b569d25b5810213ae7e52c04df4e5e0cf8d46 (diff) |
Remove the mutex classes in favor of C++0x's std::mutex and std::lock_guard
-rw-r--r-- | Attic/mutex.h (renamed from src/utils/mutex.h) | 0 | ||||
-rw-r--r-- | Attic/mutex/noop_mutex/info.txt (renamed from src/mutex/noop_mutex/info.txt) | 0 | ||||
-rw-r--r-- | Attic/mutex/noop_mutex/mux_noop.cpp (renamed from src/mutex/noop_mutex/mux_noop.cpp) | 0 | ||||
-rw-r--r-- | Attic/mutex/noop_mutex/mux_noop.h (renamed from src/mutex/noop_mutex/mux_noop.h) | 0 | ||||
-rw-r--r-- | Attic/mutex/pthreads/info.txt (renamed from src/mutex/pthreads/info.txt) | 0 | ||||
-rw-r--r-- | Attic/mutex/pthreads/mux_pthr.cpp (renamed from src/mutex/pthreads/mux_pthr.cpp) | 0 | ||||
-rw-r--r-- | Attic/mutex/pthreads/mux_pthr.h (renamed from src/mutex/pthreads/mux_pthr.h) | 0 | ||||
-rw-r--r-- | Attic/mutex/qt_mutex/info.txt (renamed from src/mutex/qt_mutex/info.txt) | 0 | ||||
-rw-r--r-- | Attic/mutex/qt_mutex/mux_qt.cpp (renamed from src/mutex/qt_mutex/mux_qt.cpp) | 0 | ||||
-rw-r--r-- | Attic/mutex/qt_mutex/mux_qt.h (renamed from src/mutex/qt_mutex/mux_qt.h) | 0 | ||||
-rw-r--r-- | Attic/mutex/win32_crit_section/info.txt (renamed from src/mutex/win32_crit_section/info.txt) | 0 | ||||
-rw-r--r-- | Attic/mutex/win32_crit_section/mux_win32.cpp (renamed from src/mutex/win32_crit_section/mux_win32.cpp) | 0 | ||||
-rw-r--r-- | Attic/mutex/win32_crit_section/mux_win32.h (renamed from src/mutex/win32_crit_section/mux_win32.h) | 0 | ||||
-rw-r--r-- | src/algo_factory/algo_cache.h | 16 | ||||
-rw-r--r-- | src/algo_factory/algo_factory.cpp | 11 | ||||
-rw-r--r-- | src/algo_factory/algo_factory.h | 5 | ||||
-rw-r--r-- | src/alloc/alloc_mmap/mmap_mem.h | 1 | ||||
-rw-r--r-- | src/alloc/mem_pool/mem_pool.cpp | 9 | ||||
-rw-r--r-- | src/alloc/mem_pool/mem_pool.h | 6 | ||||
-rw-r--r-- | src/alloc/system_alloc/defalloc.h | 2 | ||||
-rw-r--r-- | src/libstate/init.cpp | 35 | ||||
-rw-r--r-- | src/libstate/libstate.cpp | 76 | ||||
-rw-r--r-- | src/libstate/libstate.h | 21 | ||||
-rw-r--r-- | src/utils/info.txt | 1 | ||||
-rw-r--r-- | src/utils/scan_name.cpp | 1 |
25 files changed, 51 insertions, 133 deletions
diff --git a/src/utils/mutex.h b/Attic/mutex.h index a04ff83c9..a04ff83c9 100644 --- a/src/utils/mutex.h +++ b/Attic/mutex.h diff --git a/src/mutex/noop_mutex/info.txt b/Attic/mutex/noop_mutex/info.txt index 1f49f5e1c..1f49f5e1c 100644 --- a/src/mutex/noop_mutex/info.txt +++ b/Attic/mutex/noop_mutex/info.txt diff --git a/src/mutex/noop_mutex/mux_noop.cpp b/Attic/mutex/noop_mutex/mux_noop.cpp index 5c45084fe..5c45084fe 100644 --- a/src/mutex/noop_mutex/mux_noop.cpp +++ b/Attic/mutex/noop_mutex/mux_noop.cpp diff --git a/src/mutex/noop_mutex/mux_noop.h b/Attic/mutex/noop_mutex/mux_noop.h index 94201cb7c..94201cb7c 100644 --- a/src/mutex/noop_mutex/mux_noop.h +++ b/Attic/mutex/noop_mutex/mux_noop.h diff --git a/src/mutex/pthreads/info.txt b/Attic/mutex/pthreads/info.txt index 88de70de0..88de70de0 100644 --- a/src/mutex/pthreads/info.txt +++ b/Attic/mutex/pthreads/info.txt diff --git a/src/mutex/pthreads/mux_pthr.cpp b/Attic/mutex/pthreads/mux_pthr.cpp index 9f1d9816e..9f1d9816e 100644 --- a/src/mutex/pthreads/mux_pthr.cpp +++ b/Attic/mutex/pthreads/mux_pthr.cpp diff --git a/src/mutex/pthreads/mux_pthr.h b/Attic/mutex/pthreads/mux_pthr.h index 118853947..118853947 100644 --- a/src/mutex/pthreads/mux_pthr.h +++ b/Attic/mutex/pthreads/mux_pthr.h diff --git a/src/mutex/qt_mutex/info.txt b/Attic/mutex/qt_mutex/info.txt index a21108c79..a21108c79 100644 --- a/src/mutex/qt_mutex/info.txt +++ b/Attic/mutex/qt_mutex/info.txt diff --git a/src/mutex/qt_mutex/mux_qt.cpp b/Attic/mutex/qt_mutex/mux_qt.cpp index 0f670c8b4..0f670c8b4 100644 --- a/src/mutex/qt_mutex/mux_qt.cpp +++ b/Attic/mutex/qt_mutex/mux_qt.cpp diff --git a/src/mutex/qt_mutex/mux_qt.h b/Attic/mutex/qt_mutex/mux_qt.h index 5aed77f4b..5aed77f4b 100644 --- a/src/mutex/qt_mutex/mux_qt.h +++ b/Attic/mutex/qt_mutex/mux_qt.h diff --git a/src/mutex/win32_crit_section/info.txt b/Attic/mutex/win32_crit_section/info.txt index a2d339c3b..a2d339c3b 100644 --- a/src/mutex/win32_crit_section/info.txt +++ b/Attic/mutex/win32_crit_section/info.txt diff --git a/src/mutex/win32_crit_section/mux_win32.cpp b/Attic/mutex/win32_crit_section/mux_win32.cpp index 2a967892b..2a967892b 100644 --- a/src/mutex/win32_crit_section/mux_win32.cpp +++ b/Attic/mutex/win32_crit_section/mux_win32.cpp diff --git a/src/mutex/win32_crit_section/mux_win32.h b/Attic/mutex/win32_crit_section/mux_win32.h index a91850e71..a91850e71 100644 --- a/src/mutex/win32_crit_section/mux_win32.h +++ b/Attic/mutex/win32_crit_section/mux_win32.h diff --git a/src/algo_factory/algo_cache.h b/src/algo_factory/algo_cache.h index 17ea9964a..97e14f85a 100644 --- a/src/algo_factory/algo_cache.h +++ b/src/algo_factory/algo_cache.h @@ -5,8 +5,9 @@ #ifndef BOTAN_ALGORITHM_CACHE_TEMPLATE_H__ #define BOTAN_ALGORITHM_CACHE_TEMPLATE_H__ -#include <botan/mutex.h> +#include <botan/types.h> #include <botan/stl_util.h> +#include <mutex> #include <string> #include <vector> #include <map> @@ -47,7 +48,6 @@ class Algorithm_Cache */ std::vector<std::string> providers_of(const std::string& algo_name); - Algorithm_Cache(Mutex* m) : mutex(m) {} ~Algorithm_Cache(); private: typedef typename std::map<std::string, std::map<std::string, T*> >::iterator @@ -57,7 +57,7 @@ class Algorithm_Cache algorithms_iterator find_algorithm(const std::string& algo_spec); - Mutex* mutex; + std::mutex mutex; std::map<std::string, std::string> aliases; std::map<std::string, std::string> pref_providers; std::map<std::string, std::map<std::string, T*> > algorithms; @@ -93,7 +93,7 @@ template<typename T> const T* Algorithm_Cache<T>::get(const std::string& algo_spec, const std::string& requested_provider) { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); algorithms_iterator algo = find_algorithm(algo_spec); if(algo == algorithms.end()) // algo not found at all (no providers) @@ -145,7 +145,7 @@ void Algorithm_Cache<T>::add(T* algo, if(!algo) return; - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); delete algorithms[algo->name()][provider]; algorithms[algo->name()][provider] = algo; @@ -163,7 +163,7 @@ void Algorithm_Cache<T>::add(T* algo, template<typename T> std::vector<std::string> Algorithm_Cache<T>::providers_of(const std::string& algo_name) { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); std::vector<std::string> providers; @@ -190,7 +190,7 @@ template<typename T> void Algorithm_Cache<T>::set_preferred_provider(const std::string& algo_spec, const std::string& provider) { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); pref_providers[algo_spec] = provider; } @@ -215,8 +215,6 @@ Algorithm_Cache<T>::~Algorithm_Cache() ++algo; } - - delete mutex; } } diff --git a/src/algo_factory/algo_factory.cpp b/src/algo_factory/algo_factory.cpp index 269c58c3b..71bd26827 100644 --- a/src/algo_factory/algo_factory.cpp +++ b/src/algo_factory/algo_factory.cpp @@ -80,15 +80,14 @@ const T* factory_prototype(const std::string& algo_spec, /** * Setup caches */ -Algorithm_Factory::Algorithm_Factory(const std::vector<Engine*>& engines_in, - Mutex_Factory& mf) +Algorithm_Factory::Algorithm_Factory(const std::vector<Engine*>& engines_in) { engines = engines_in; - block_cipher_cache = new Algorithm_Cache<BlockCipher>(mf.make()); - stream_cipher_cache = new Algorithm_Cache<StreamCipher>(mf.make()); - hash_cache = new Algorithm_Cache<HashFunction>(mf.make()); - mac_cache = new Algorithm_Cache<MessageAuthenticationCode>(mf.make()); + block_cipher_cache = new Algorithm_Cache<BlockCipher>(); + stream_cipher_cache = new Algorithm_Cache<StreamCipher>(); + hash_cache = new Algorithm_Cache<HashFunction>(); + mac_cache = new Algorithm_Cache<MessageAuthenticationCode>(); } /** diff --git a/src/algo_factory/algo_factory.h b/src/algo_factory/algo_factory.h index 73e592013..1f4b577ee 100644 --- a/src/algo_factory/algo_factory.h +++ b/src/algo_factory/algo_factory.h @@ -8,7 +8,7 @@ #ifndef BOTAN_ALGORITHM_FACTORY_H__ #define BOTAN_ALGORITHM_FACTORY_H__ -#include <botan/mutex.h> +#include <botan/types.h> #include <string> #include <vector> @@ -37,8 +37,7 @@ class BOTAN_DLL Algorithm_Factory * @param engines_in the list of engines to use * @param mf a mutex factory */ - Algorithm_Factory(const std::vector<Engine*>& engines_in, - Mutex_Factory& mf); + Algorithm_Factory(const std::vector<Engine*>& engines_in); /** * Destructor diff --git a/src/alloc/alloc_mmap/mmap_mem.h b/src/alloc/alloc_mmap/mmap_mem.h index bef166a16..30e6d9ebb 100644 --- a/src/alloc/alloc_mmap/mmap_mem.h +++ b/src/alloc/alloc_mmap/mmap_mem.h @@ -18,7 +18,6 @@ namespace Botan { class BOTAN_DLL MemoryMapping_Allocator : public Pooling_Allocator { public: - MemoryMapping_Allocator(Mutex* m) : Pooling_Allocator(m) {} std::string type() const { return "mmap"; } private: void* alloc_block(u32bit); diff --git a/src/alloc/mem_pool/mem_pool.cpp b/src/alloc/mem_pool/mem_pool.cpp index 38e0c3285..a3858add6 100644 --- a/src/alloc/mem_pool/mem_pool.cpp +++ b/src/alloc/mem_pool/mem_pool.cpp @@ -109,7 +109,7 @@ void Pooling_Allocator::Memory_Block::free(void* ptr, u32bit blocks) throw() /* * Pooling_Allocator Constructor */ -Pooling_Allocator::Pooling_Allocator(Mutex* m) : mutex(m) +Pooling_Allocator::Pooling_Allocator() { last_used = blocks.begin(); } @@ -119,7 +119,6 @@ Pooling_Allocator::Pooling_Allocator(Mutex* m) : mutex(m) */ Pooling_Allocator::~Pooling_Allocator() { - delete mutex; if(blocks.size()) throw Invalid_State("Pooling_Allocator: Never released memory"); } @@ -129,7 +128,7 @@ Pooling_Allocator::~Pooling_Allocator() */ void Pooling_Allocator::destroy() { - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); blocks.clear(); @@ -146,7 +145,7 @@ void* Pooling_Allocator::allocate(u32bit n) const u32bit BITMAP_SIZE = Memory_Block::bitmap_size(); const u32bit BLOCK_SIZE = Memory_Block::block_size(); - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); if(n <= BITMAP_SIZE * BLOCK_SIZE) { @@ -183,7 +182,7 @@ void Pooling_Allocator::deallocate(void* ptr, u32bit n) if(ptr == 0 && n == 0) return; - Mutex_Holder lock(mutex); + std::lock_guard<std::mutex> lock(mutex); if(n > BITMAP_SIZE * BLOCK_SIZE) dealloc_block(ptr, n); diff --git a/src/alloc/mem_pool/mem_pool.h b/src/alloc/mem_pool/mem_pool.h index a57800972..871f135bd 100644 --- a/src/alloc/mem_pool/mem_pool.h +++ b/src/alloc/mem_pool/mem_pool.h @@ -10,7 +10,7 @@ #include <botan/allocate.h> #include <botan/exceptn.h> -#include <botan/mutex.h> +#include <mutex> #include <utility> #include <vector> @@ -27,7 +27,7 @@ class BOTAN_DLL Pooling_Allocator : public Allocator void destroy(); - Pooling_Allocator(Mutex*); + Pooling_Allocator(); ~Pooling_Allocator(); private: void get_more_core(u32bit); @@ -66,7 +66,7 @@ class BOTAN_DLL Pooling_Allocator : public Allocator std::vector<Memory_Block> blocks; std::vector<Memory_Block>::iterator last_used; std::vector<std::pair<void*, u32bit> > allocated; - Mutex* mutex; + std::mutex mutex; }; } diff --git a/src/alloc/system_alloc/defalloc.h b/src/alloc/system_alloc/defalloc.h index 627e8df70..ed2682ec0 100644 --- a/src/alloc/system_alloc/defalloc.h +++ b/src/alloc/system_alloc/defalloc.h @@ -30,8 +30,6 @@ class BOTAN_DLL Malloc_Allocator : public Allocator class BOTAN_DLL Locking_Allocator : public Pooling_Allocator { public: - Locking_Allocator(Mutex* m) : Pooling_Allocator(m) {} - std::string type() const { return "locking"; } private: void* alloc_block(u32bit); diff --git a/src/libstate/init.cpp b/src/libstate/init.cpp index b908de6c7..0d9a2420c 100644 --- a/src/libstate/init.cpp +++ b/src/libstate/init.cpp @@ -1,12 +1,11 @@ /** * Default Initialization Function -* (C) 1999-2007 Jack Lloyd +* (C) 1999-2009 Jack Lloyd * * Distributed under the terms of the Botan license */ #include <botan/init.h> -#include <botan/parsing.h> #include <botan/libstate.h> namespace Botan { @@ -14,36 +13,8 @@ namespace Botan { /* * Library Initialization */ -void LibraryInitializer::initialize(const std::string& arg_string) +void LibraryInitializer::initialize(const std::string&) { - bool thread_safe = false; - - const std::vector<std::string> arg_list = split_on(arg_string, ' '); - for(u32bit j = 0; j != arg_list.size(); ++j) - { - if(arg_list[j].size() == 0) - continue; - - std::string name, value; - - if(arg_list[j].find('=') == std::string::npos) - { - name = arg_list[j]; - value = "true"; - } - else - { - std::vector<std::string> name_and_value = split_on(arg_list[j], '='); - name = name_and_value[0]; - value = name_and_value[1]; - } - - bool is_on = - (value == "1" || value == "true" || value == "yes" || value == "on"); - - if(name == "thread_safe") - thread_safe = is_on; - } try { @@ -55,7 +26,7 @@ void LibraryInitializer::initialize(const std::string& arg_string) */ set_global_state(new Library_State); - global_state().initialize(thread_safe); + global_state().initialize(); } catch(...) { diff --git a/src/libstate/libstate.cpp b/src/libstate/libstate.cpp index 3275c6493..839d71d60 100644 --- a/src/libstate/libstate.cpp +++ b/src/libstate/libstate.cpp @@ -9,21 +9,12 @@ #include <botan/init.h> #include <botan/engine.h> #include <botan/stl_util.h> -#include <botan/mutex.h> #include <botan/mux_noop.h> #include <botan/charset.h> #include <botan/defalloc.h> #include <botan/def_eng.h> #include <algorithm> -#if defined(BOTAN_HAS_MUTEX_PTHREAD) - #include <botan/mux_pthr.h> -#elif defined(BOTAN_HAS_MUTEX_WIN32) - #include <botan/mux_win32.h> -#elif defined(BOTAN_HAS_MUTEX_QT) - #include <botan/mux_qt.h> -#endif - #if defined(BOTAN_HAS_ALLOC_MMAP) #include <botan/mmap_mem.h> #endif @@ -92,19 +83,11 @@ Library_State* swap_global_state(Library_State* new_state) } /* -* Get a new mutex object -*/ -Mutex* Library_State::get_mutex() const - { - return mutex_factory->make(); - } - -/* * Get an allocator by its name */ -Allocator* Library_State::get_allocator(const std::string& type) const +Allocator* Library_State::get_allocator(const std::string& type) { - Mutex_Holder lock(allocator_lock); + std::lock_guard<std::mutex> lock(allocator_lock); if(type != "") return search_map<std::string, Allocator*>(alloc_factory, type, 0); @@ -128,7 +111,7 @@ Allocator* Library_State::get_allocator(const std::string& type) const */ void Library_State::add_allocator(Allocator* allocator) { - Mutex_Holder lock(allocator_lock); + std::lock_guard<std::mutex> lock(allocator_lock); allocator->init(); @@ -141,7 +124,7 @@ void Library_State::add_allocator(Allocator* allocator) */ void Library_State::set_default_allocator(const std::string& type) { - Mutex_Holder lock(allocator_lock); + std::lock_guard<std::mutex> lock(allocator_lock); if(type == "") return; @@ -154,9 +137,9 @@ void Library_State::set_default_allocator(const std::string& type) * Get a configuration value */ std::string Library_State::get(const std::string& section, - const std::string& key) const + const std::string& key) { - Mutex_Holder lock(config_lock); + std::lock_guard<std::mutex> lock(config_lock); return search_map<std::string, std::string>(config, section + "/" + key, ""); @@ -166,9 +149,9 @@ std::string Library_State::get(const std::string& section, * See if a particular option has been set */ bool Library_State::is_set(const std::string& section, - const std::string& key) const + const std::string& key) { - Mutex_Holder lock(config_lock); + std::lock_guard<std::mutex> lock(config_lock); return search_map(config, section + "/" + key, false, true); } @@ -179,7 +162,7 @@ bool Library_State::is_set(const std::string& section, void Library_State::set(const std::string& section, const std::string& key, const std::string& value, bool overwrite) { - Mutex_Holder lock(config_lock); + std::lock_guard<std::mutex> lock(config_lock); std::string full_key = section + "/" + key; @@ -201,7 +184,7 @@ void Library_State::add_alias(const std::string& key, const std::string& value) /* * Dereference an alias to a fixed name */ -std::string Library_State::deref_alias(const std::string& key) const +std::string Library_State::deref_alias(const std::string& key) { std::string result = key; while(is_set("alias", result)) @@ -221,7 +204,7 @@ void Library_State::set_option(const std::string key, /* * Get an option value */ -std::string Library_State::option(const std::string& key) const +std::string Library_State::option(const std::string& key) { return get("conf", key); } @@ -239,38 +222,18 @@ Algorithm_Factory& Library_State::algorithm_factory() /* * Load a set of modules */ -void Library_State::initialize(bool thread_safe) +void Library_State::initialize() { - if(mutex_factory) + if(m_algorithm_factory) throw Invalid_State("Library_State has already been initialized"); - if(!thread_safe) - { - mutex_factory = new Noop_Mutex_Factory; - } - else - { -#if defined(BOTAN_HAS_MUTEX_PTHREAD) - mutex_factory = new Pthread_Mutex_Factory; -#elif defined(BOTAN_HAS_MUTEX_WIN32) - mutex_factory = new Win32_Mutex_Factory; -#elif defined(BOTAN_HAS_MUTEX_QT) - mutex_factory Qt_Mutex_Factory; -#else - throw Invalid_State("Could not find a thread-safe mutex object to use"); -#endif - } - - allocator_lock = mutex_factory->make(); - config_lock = mutex_factory->make(); - cached_default_allocator = 0; add_allocator(new Malloc_Allocator); - add_allocator(new Locking_Allocator(mutex_factory->make())); + add_allocator(new Locking_Allocator); #if defined(BOTAN_HAS_ALLOC_MMAP) - add_allocator(new MemoryMapping_Allocator(mutex_factory->make())); + add_allocator(new MemoryMapping_Allocator); #endif set_default_allocator("locking"); @@ -301,7 +264,7 @@ void Library_State::initialize(bool thread_safe) engines.push_back(new Default_Engine); - m_algorithm_factory = new Algorithm_Factory(engines, *mutex_factory); + m_algorithm_factory = new Algorithm_Factory(engines); } /* @@ -309,8 +272,6 @@ void Library_State::initialize(bool thread_safe) */ Library_State::Library_State() { - mutex_factory = 0; - allocator_lock = config_lock = 0; cached_default_allocator = 0; m_algorithm_factory = 0; } @@ -321,6 +282,7 @@ Library_State::Library_State() Library_State::~Library_State() { delete m_algorithm_factory; + m_algorithm_factory = 0; cached_default_allocator = 0; @@ -329,10 +291,6 @@ Library_State::~Library_State() allocators[j]->destroy(); delete allocators[j]; } - - delete allocator_lock; - delete mutex_factory; - delete config_lock; } } diff --git a/src/libstate/libstate.h b/src/libstate/libstate.h index 2493863a9..eb3b3b3be 100644 --- a/src/libstate/libstate.h +++ b/src/libstate/libstate.h @@ -12,6 +12,7 @@ #include <botan/allocate.h> #include <botan/algo_factory.h> +#include <mutex> #include <string> #include <vector> #include <map> @@ -27,11 +28,11 @@ class BOTAN_DLL Library_State Library_State(); ~Library_State(); - void initialize(bool thread_safe); + void initialize(); Algorithm_Factory& algorithm_factory(); - Allocator* get_allocator(const std::string& = "") const; + Allocator* get_allocator(const std::string& = ""); void add_allocator(Allocator*); void set_default_allocator(const std::string&); @@ -42,7 +43,7 @@ class BOTAN_DLL Library_State * @result the value of the parameter */ std::string get(const std::string& section, - const std::string& key) const; + const std::string& key); /** * Check whether a certain parameter is set @@ -52,7 +53,7 @@ class BOTAN_DLL Library_State * @result true if the parameters value is set, * false otherwise */ - bool is_set(const std::string& section, const std::string& key) const; + bool is_set(const std::string& section, const std::string& key); /** * Set a configuration parameter. @@ -70,7 +71,7 @@ class BOTAN_DLL Library_State * referred to as option). * @param key the desired keys name */ - std::string option(const std::string& key) const; + std::string option(const std::string& key); /** * Set an option. @@ -91,21 +92,17 @@ class BOTAN_DLL Library_State * @param alias the alias to resolve. * @return what the alias stands for */ - std::string deref_alias(const std::string&) const; - - class Mutex* get_mutex() const; + std::string deref_alias(const std::string&); private: void load_default_config(); Library_State(const Library_State&) {} Library_State& operator=(const Library_State&) { return (*this); } - class Mutex_Factory* mutex_factory; - + std::mutex config_lock; std::map<std::string, std::string> config; - class Mutex* config_lock; - class Mutex* allocator_lock; + std::mutex allocator_lock; std::map<std::string, Allocator*> alloc_factory; mutable Allocator* cached_default_allocator; std::vector<Allocator*> allocators; diff --git a/src/utils/info.txt b/src/utils/info.txt index ffc19c852..815ad4efc 100644 --- a/src/utils/info.txt +++ b/src/utils/info.txt @@ -27,7 +27,6 @@ exceptn.h loadstor.h mem_ops.h mlock.cpp -mutex.h parsing.cpp parsing.h rotate.h diff --git a/src/utils/scan_name.cpp b/src/utils/scan_name.cpp index 3425425e2..92fded3c4 100644 --- a/src/utils/scan_name.cpp +++ b/src/utils/scan_name.cpp @@ -8,6 +8,7 @@ SCAN Name Abstraction #include <botan/scan_name.h> #include <botan/parsing.h> #include <botan/libstate.h> +#include <botan/exceptn.h> #include <stdexcept> #include <iostream> |