diff options
author | lloyd <[email protected]> | 2009-11-17 07:20:51 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-11-17 07:20:51 +0000 |
commit | 7a24783fd58b21e1ea59615025806663e5f231eb (patch) | |
tree | b77c685e0b54f82890947009631461bcfe5b6880 /Attic/mutex/qt_mutex | |
parent | e00b46cf9c1dcb364ebb7d5968d6ff9dcd600c4e (diff) | |
parent | 471847e2148776e62e4f580ade95572fc525c751 (diff) |
propagate from branch 'net.randombit.botan' (head 0ac5a29496b4e50775827d9655c064f6d1c98813)
to branch 'net.randombit.botan.c++0x' (head 3232da044d41756582b53da9d14c3ac07e9b2916)
Diffstat (limited to 'Attic/mutex/qt_mutex')
-rw-r--r-- | Attic/mutex/qt_mutex/info.txt | 9 | ||||
-rw-r--r-- | Attic/mutex/qt_mutex/mux_qt.cpp | 35 | ||||
-rw-r--r-- | Attic/mutex/qt_mutex/mux_qt.h | 27 |
3 files changed, 71 insertions, 0 deletions
diff --git a/Attic/mutex/qt_mutex/info.txt b/Attic/mutex/qt_mutex/info.txt new file mode 100644 index 000000000..346f04c81 --- /dev/null +++ b/Attic/mutex/qt_mutex/info.txt @@ -0,0 +1,9 @@ +define MUTEX_QT + +load_on request + +# I think we want to always use qt-mt, not qt -- not much point in supporting +# mutexes in a single threaded application, after all. +<libs> +all -> qt-mt +</libs> diff --git a/Attic/mutex/qt_mutex/mux_qt.cpp b/Attic/mutex/qt_mutex/mux_qt.cpp new file mode 100644 index 000000000..0f670c8b4 --- /dev/null +++ b/Attic/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(); + } + +} diff --git a/Attic/mutex/qt_mutex/mux_qt.h b/Attic/mutex/qt_mutex/mux_qt.h new file mode 100644 index 000000000..5aed77f4b --- /dev/null +++ b/Attic/mutex/qt_mutex/mux_qt.h @@ -0,0 +1,27 @@ +/* +* Qt Mutex +* (C) 2004-2007 Justin Karneges +* 2004-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ + +#ifndef BOTAN_MUTEX_QT_H__ +#define BOTAN_MUTEX_QT_H__ + +#include <botan/mutex.h> + +namespace Botan { + +/* +* Qt Mutex +*/ +class BOTAN_DLL Qt_Mutex_Factory : public Mutex_Factory + { + public: + Mutex* make(); + }; + +} + +#endif |