41 #ifndef QTLOCKEDFILE_H
42 #define QTLOCKEDFILE_H
50 # if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT)
51 # define QT_QTLOCKEDFILE_EXPORT
52 # elif defined(QT_QTLOCKEDFILE_IMPORT)
53 # if defined(QT_QTLOCKEDFILE_EXPORT)
54 # undef QT_QTLOCKEDFILE_EXPORT
56 # define QT_QTLOCKEDFILE_EXPORT __declspec(dllimport)
57 # elif defined(QT_QTLOCKEDFILE_EXPORT)
58 # undef QT_QTLOCKEDFILE_EXPORT
59 # define QT_QTLOCKEDFILE_EXPORT __declspec(dllexport)
62 # define QT_QTLOCKEDFILE_EXPORT
65 namespace QtLP_Private {
70 enum LockMode { NoLock = 0, ReadLock, WriteLock };
76 bool open(OpenMode mode);
78 bool lock(LockMode mode,
bool block =
true);
80 bool isLocked()
const;
81 LockMode lockMode()
const;
87 QVector<Qt::HANDLE> rmutexes;
90 Qt::HANDLE getMutexHandle(
int idx,
bool doCreate);
91 bool waitMutex(Qt::HANDLE mutex,
bool doBlock);