diff options
author | lloyd <[email protected]> | 2009-06-04 16:06:59 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-06-04 16:06:59 +0000 |
commit | 9de911f55808e84e8d14efbecf8379c25afb9d50 (patch) | |
tree | da2d3825ed58833ae40fc0ffa3e704473aafd0e0 /Attic/mutex/qt_mutex/mux_qt.cpp | |
parent | a96eae0b3394b64aea544f9f0ce4664d3b4a5c58 (diff) | |
parent | 3afb86663583b982e1eab8f46d07fc3d51260602 (diff) |
propagate from branch 'net.randombit.botan' (head 6a746ccf1e957dba703e65372050a7bd4d6b117d)
to branch 'net.randombit.botan.c++0x' (head f54bb7b391eb3b71f380a68ddd460debdc31545d)
Diffstat (limited to 'Attic/mutex/qt_mutex/mux_qt.cpp')
-rw-r--r-- | Attic/mutex/qt_mutex/mux_qt.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
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(); + } + +} |