FileGuard Class

class QInstaller::FileGuard

The FileGuard class provides basic access serialization for file paths. More...

Header: #include <FileGuard>

Public Functions

void release(const QString &path)
bool tryLock(const QString &path)

Static Public Members

FileGuard *globalObject()

Detailed Description

This class keeps a list of file paths that are locked from mutual access. Attempting to lock them from another thread will fail until the the locked path name is released.

Member Function Documentation

[static] FileGuard *FileGuard::globalObject()

Returns the application global instance.

void FileGuard::release(const QString &path)

Unlocks path.

bool FileGuard::tryLock(const QString &path)

Attempts to lock path. Returns true if the lock could be acquired, false if another thread has already locked the path.