aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mutex/qt_mutex/mux_qt.cpp
blob: 421b771c7ef5e621f3d5e94d69b4a07a671b212e (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
/*************************************************
* Qt Thread Mutex Source File                    *
* (C) 2004-2007 Justin Karneges                  *
*     2004-2007 Jack Lloyd                       *
*************************************************/

#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();
   }

}