aboutsummaryrefslogtreecommitdiffstats
path: root/src/mutex.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-04-02 18:52:13 +0000
committerlloyd <[email protected]>2008-04-02 18:52:13 +0000
commit8a5ffc5c6294786ad70f7a8fdd7606f411690ce9 (patch)
tree16b7d8d757e1ac6c8b2460d3e6a42768de466c8c /src/mutex.cpp
parent91c318bbad1fcff1c9b04f1077fb4ec75d59a549 (diff)
Remove the Named_Mutex_Holder and associated code. Convert all uses to
instead allocate a reference to a mutex locally and use the more typical Mutex_Holder RAII object. Named_Mutex_Holder (and in particular the string->mutex mappings contained in the global state) have been found to be pretty expensive in at least some situations (see post by Jack Cummings to monotone-devel 2008-03-12), and doesn't really buy us that much in terms of ease of use. Also, it relies on the global state object, which has shown itself to be a rich source of race conditions and locking bugs. The intent is to incrementally remove all of the shared / global state and require applications to maintain that state where necessary.
Diffstat (limited to 'src/mutex.cpp')
-rw-r--r--src/mutex.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/mutex.cpp b/src/mutex.cpp
index fb2d8308d..387f10e95 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -4,7 +4,6 @@
*************************************************/
#include <botan/mutex.h>
-#include <botan/libstate.h>
namespace Botan {
@@ -27,23 +26,6 @@ Mutex_Holder::~Mutex_Holder()
}
/*************************************************
-* Named_Mutex_Holder Constructor *
-*************************************************/
-Named_Mutex_Holder::Named_Mutex_Holder(const std::string& name) :
- mutex_name(name)
- {
- global_state().get_named_mutex(mutex_name)->lock();
- }
-
-/*************************************************
-* Named_Mutex_Holder Destructor *
-*************************************************/
-Named_Mutex_Holder::~Named_Mutex_Holder()
- {
- global_state().get_named_mutex(mutex_name)->unlock();
- }
-
-/*************************************************
* Default Mutex Factory *
*************************************************/
Mutex* Default_Mutex_Factory::make()