/**************************************************************************** * * (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> * * QGroundControl is licensed according to the terms in the file * COPYING.md in the root of the source code directory. * ****************************************************************************/#ifndef RunGuard_H#define RunGuard_H#include <QObject>#include <QSharedMemory>#include <QSystemSemaphore>classRunGuard{public:RunGuard(constQString&key);~RunGuard();boolisAnotherRunning();booltryToRun();voidrelease();private:constQStringkey;constQStringmemLockKey;constQStringsharedmemKey;QSharedMemorysharedMem;QSystemSemaphorememLock;Q_DISABLE_COPY(RunGuard)};#endif