aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mux_qt/mux_qt.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 19:01:03 +0000
committerlloyd <[email protected]>2006-05-18 19:01:03 +0000
commitc3ae40d21245315a5bfb913820c20d0d2896522c (patch)
tree7d4db3edb082cd1d0a17c97137dc27972dba9c4a /modules/mux_qt/mux_qt.cpp
parenta2c99d3270eb73ef2db5704fc54356c6b75096f8 (diff)
Rename mod_qt to mux_qt, as all (very minimal) non-mutex functionality
is going to be removed.
Diffstat (limited to 'modules/mux_qt/mux_qt.cpp')
-rw-r--r--modules/mux_qt/mux_qt.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/mux_qt/mux_qt.cpp b/modules/mux_qt/mux_qt.cpp
new file mode 100644
index 000000000..0d419d38a
--- /dev/null
+++ b/modules/mux_qt/mux_qt.cpp
@@ -0,0 +1,56 @@
+/*************************************************
+* Qt Thread Mutex Source File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#include <botan/mux_qt.h>
+#include <botan/exceptn.h>
+#include <qmutex.h>
+
+#if !defined(QT_THREAD_SUPPORT)
+ #error Your version of Qt does not support threads or mutexes
+#endif
+
+namespace Botan {
+
+/*************************************************
+* Wrapper Type for Qt Thread Mutex *
+*************************************************/
+struct mutex_wrapper
+ {
+ QMutex m;
+ };
+
+/*************************************************
+* Constructor *
+*************************************************/
+Qt_Mutex::Qt_Mutex()
+ {
+ mutex = new mutex_wrapper;
+ }
+
+/*************************************************
+* Destructor *
+*************************************************/
+Qt_Mutex::~Qt_Mutex()
+ {
+ delete mutex;
+ }
+
+/*************************************************
+* Lock the Mutex *
+*************************************************/
+void Qt_Mutex::lock()
+ {
+ mutex->m.lock();
+ }
+
+/*************************************************
+* Unlock the Mutex *
+*************************************************/
+void Qt_Mutex::unlock()
+ {
+ mutex->m.unlock();
+ }
+
+}