mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
[libcalamares] Move kdsingleapplicationguard to 3rdparty
This commit is contained in:
parent
47dbf9ab0c
commit
e7c66de4df
11 changed files with 0 additions and 0 deletions
40
3rdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp
vendored
Normal file
40
3rdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include "kdsharedmemorylocker.h"
|
||||
|
||||
#if QT_VERSION >= 0x040400 || defined( DOXYGEN_RUN )
|
||||
|
||||
#include <QSharedMemory>
|
||||
|
||||
using namespace kdtools;
|
||||
|
||||
/*!
|
||||
\class KDSharedMemoryLocker
|
||||
\ingroup raii core
|
||||
\brief Exception-safe and convenient wrapper around QSharedMemory::lock()
|
||||
*/
|
||||
|
||||
/**
|
||||
* Constructor. Locks the shared memory segment \a mem.
|
||||
* If another process has locking the segment, this constructor blocks
|
||||
* until the lock is released. The memory segments needs to be properly created or attached.
|
||||
*/
|
||||
KDSharedMemoryLocker::KDSharedMemoryLocker( QSharedMemory* mem )
|
||||
: mem( mem )
|
||||
{
|
||||
mem->lock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor. Unlocks the shared memory segment associated with this
|
||||
* KDSharedMemoryLocker.
|
||||
*/
|
||||
KDSharedMemoryLocker::~KDSharedMemoryLocker()
|
||||
{
|
||||
mem->unlock();
|
||||
}
|
||||
|
||||
#ifdef KDAB_EVAL
|
||||
#include KDAB_EVAL
|
||||
static const EvalDialogChecker evalChecker( "KD Tools", false );
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue