summaryrefslogtreecommitdiffstats
path: root/botan/src/mutex/qt_mutex/mux_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'botan/src/mutex/qt_mutex/mux_qt.cpp')
-rw-r--r--botan/src/mutex/qt_mutex/mux_qt.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/botan/src/mutex/qt_mutex/mux_qt.cpp b/botan/src/mutex/qt_mutex/mux_qt.cpp
new file mode 100644
index 0000000..0f670c8
--- /dev/null
+++ b/botan/src/mutex/qt_mutex/mux_qt.cpp
@@ -0,0 +1,35 @@
+/*
+* Qt Thread Mutex
+* (C) 2004-2007 Justin Karneges
+* 2004-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#include <botan/mux_qt.h>
+#include <qmutex.h>
+
+#if !defined(QT_THREAD_SUPPORT)
+ #error Your version of Qt does not support threads or mutexes
+#endif
+
+namespace Botan {
+
+/*
+* Qt Mutex Factory
+*/
+Mutex* Qt_Mutex_Factory::make()
+ {
+ class Qt_Mutex : public Mutex
+ {
+ public:
+ void lock() { mutex.lock(); }
+ void unlock() { mutex.unlock(); }
+ private:
+ QMutex mutex;
+ };
+
+ return new Qt_Mutex();
+ }
+
+}