aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mux_qt/mux_qt.cpp
blob: 93c1b8a07cefdc768b4e377c132b06ed1b25a785 (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
/*************************************************
* Qt Thread Mutex Source File                    *
* (C) 1999-2007 The Botan Project                *
*************************************************/

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

}