mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 12:44:07 +00:00
7859daaff6
which can provide results asyncronously, be discarded prematurely etc. This work touches just about every piece of exiting code. + On top of the new interface, MediaWiki (Wikipedia) support was added. * Some other small fixes might went along.
33 lines
732 B
C++
33 lines
732 B
C++
/* This file is (c) 2008-2009 Konstantin Isakov <ikm@users.berlios.de>
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
#ifndef __MUTEX_HH_INCLUDED__
|
|
#define __MUTEX_HH_INCLUDED__
|
|
|
|
#include <QMutex>
|
|
|
|
/// This provides a mutex class. As you can see, it's just a Qt one, but it
|
|
/// does provide the Lock class which doesn't seem to exist in Qt, and it does
|
|
/// provide some abstraction for dictionaries in case they are to be ported
|
|
/// away from Qt.
|
|
class Mutex: public QMutex
|
|
{
|
|
public:
|
|
|
|
/// Locks the given mutex on construction and unlocks on destruction
|
|
class Lock
|
|
{
|
|
Mutex & m;
|
|
|
|
public:
|
|
|
|
Lock( Mutex & );
|
|
~Lock();
|
|
|
|
private:
|
|
Lock( Lock const & );
|
|
};
|
|
};
|
|
|
|
#endif
|