aboutsummaryrefslogtreecommitdiffstats
path: root/src/mutex/qt_mutex/mux_qt.cpp
blob: da4e5ce5cb15890589a6d7a54e3f25005c40ed22 (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/internal/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();
   }

}