48 #ifndef QT_NO_SYSTEMSEMAPHORE 181 setKey(key, initialValue, mode);
247 #if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) && !defined(QT_POSIX_IPC) 249 if (key ==
d->
key && mode ==
Create &&
d->createdSemaphore &&
d->createdFile) {
319 qWarning(
"QSystemSemaphore::release: n is negative.");
371 #endif // QT_NO_SYSTEMSEMAPHORE
#define QT_END_NAMESPACE
This macro expands to.
QString makeKeyFileName() const
QString errorString() const
Returns a text description of the last error that occurred.
The QString class provides a Unicode character string.
QSystemSemaphore(const QString &key, int initialValue=0, AccessMode mode=Open)
Requests a system semaphore for the specified key.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Q_CORE_EXPORT void qWarning(const char *,...)
bool modifySemaphore(int count)
AccessMode
This enum is used by the constructor and setKey().
QSystemSemaphore::SystemSemaphoreError error
QScopedPointer< QSystemSemaphorePrivate > d
SystemSemaphoreError error() const
Returns a value indicating whether an error occurred, and, if so, which error it was.
void setKey(const QString &key, int initialValue=0, AccessMode mode=Open)
This function works the same as the constructor.
bool release(int n=1)
Releases n resources guarded by the semaphore.
HANDLE handle(QSystemSemaphore::AccessMode mode=QSystemSemaphore::Open)
~QSystemSemaphore()
The destructor destroys the QSystemSemaphore object, but the underlying system semaphore is not remov...
QString key() const
Returns the key assigned to this system semaphore.
bool acquire()
Acquires one of the resources guarded by this semaphore, if there is one available, and returns true.