![]() |
Qt 6.x
The Qt SDK
|
#include <qlockfile_p.h>
Collaboration diagram for QLockFilePrivate:Public Member Functions | |
| QLockFilePrivate (const QString &fn) | |
| QLockFile::LockError | tryLock_sys () |
| bool | removeStaleLock () |
| QByteArray | lockFileContents () const |
| bool | isApparentlyStale () const |
Static Public Member Functions | |
| static Q_CORE_EXPORT QString | processNameByPid (qint64 pid) |
| static bool | isProcessRunning (qint64 pid, const QString &appname) |
| static int | getLockFileHandle (QLockFile *f) |
Public Attributes | |
| QString | fileName |
| int | fileHandle = -1 |
| std::chrono::milliseconds | staleLockTime = std::chrono::seconds{30} |
| QLockFile::LockError | lockError = QLockFile::NoError |
| bool | isLocked = false |
Definition at line 31 of file qlockfile_p.h.
|
inline |
Definition at line 34 of file qlockfile_p.h.
|
inlinestatic |
Definition at line 61 of file qlockfile_p.h.
| bool QLockFilePrivate::isApparentlyStale | ( | ) | const |
Definition at line 416 of file qlockfile.cpp.
References QSysInfo::bootUniqueId(), QDateTime::currentDateTimeUtc(), fileName, getLockInfo_helper(), info, QByteArray::isEmpty(), isProcessRunning(), QFileInfo::lastModified(), machineName(), QSysInfo::machineUniqueId(), QDateTime::msecsTo(), staleLockTime, and QTimeZone::UTC.
Here is the call graph for this function:Definition at line 171 of file qlockfile_unix.cpp.
References fi, QFileInfo::fileName(), QString::isEmpty(), QFileInfo::isSymLink(), processNameByPid(), QFileInfo::setFile(), and QFileInfo::symLinkTarget().
Referenced by isApparentlyStale().
Here is the call graph for this function:
Here is the caller graph for this function:| QByteArray QLockFilePrivate::lockFileContents | ( | ) | const |
Definition at line 376 of file qlockfile.cpp.
References QCoreApplication::applicationPid(), QSysInfo::bootUniqueId(), machineName(), QSysInfo::machineUniqueId(), QByteArray::number(), processNameByPid(), and QString::toUtf8().
Referenced by tryLock_sys().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 188 of file qlockfile_unix.cpp.
References QFile::decodeName(), QFileSystemEntry::fileName(), info, PATH_MAX, Q_UNUSED, QStringLiteral, qt_haveLinuxProcfs(), qt_readlink(), qt_safe_close(), qt_safe_open(), qt_safe_read(), and Qt::Uninitialized.
Referenced by isProcessRunning(), and lockFileContents().
Here is the call graph for this function:
Here is the caller graph for this function:| bool QLockFilePrivate::removeStaleLock | ( | ) |
Definition at line 160 of file qlockfile_unix.cpp.
References QString::constData(), QFile::encodeName(), fileName, lockFileName(), qt_safe_open(), and setNativeLocks().
Here is the call graph for this function:| QLockFile::LockError QLockFilePrivate::tryLock_sys | ( | ) |
Definition at line 118 of file qlockfile_unix.cpp.
References QString::constData(), QByteArray::constData(), QFile::encodeName(), fileHandle, fileName, QLockFile::LockFailedError, lockFileContents(), lockFileName(), QLockFile::NoError, QLockFile::PermissionError, qt_error_string(), qt_safe_close(), qt_safe_open(), qt_write_loop(), qUtf16Printable, qWarning, QFile::remove(), setNativeLocks(), QByteArray::size(), and QLockFile::UnknownError.
Here is the call graph for this function:| int QLockFilePrivate::fileHandle = -1 |
Definition at line 54 of file qlockfile_p.h.
Referenced by tryLock_sys().
| QString QLockFilePrivate::fileName |
Definition at line 49 of file qlockfile_p.h.
Referenced by QLockFile::fileName(), isApparentlyStale(), removeStaleLock(), and tryLock_sys().
| bool QLockFilePrivate::isLocked = false |
Definition at line 59 of file qlockfile_p.h.
| QLockFile::LockError QLockFilePrivate::lockError = QLockFile::NoError |
Definition at line 58 of file qlockfile_p.h.
| std::chrono::milliseconds QLockFilePrivate::staleLockTime = std::chrono::seconds{30} |
Definition at line 57 of file qlockfile_p.h.
Referenced by isApparentlyStale().