summaryrefslogtreecommitdiffstats
path: root/botan/src/mutex/qt_mutex/mux_qt.cpp
blob: 0f670c8b4b22c55e2e1ec391699a58fbea0e199d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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();
   }

}