QLock Class Reference
The QLock class is a wrapper round a System V shared semaphore.
More...
#include <qlock_qws.h>
List of all member functions.
Public Members
Detailed Description
The QLock class is a wrapper round a System V shared semaphore.
It is used by Qt/Embedded for synchronizing access to the graphics
card and shared memory region between processes.
Member Function Documentation
QLock::QLock ( const QString & filename, char id, bool create = FALSE )
Creates a lock. filename is the file path of the Unix-domain socket
the Qt/Embedded client is using. Id is the name of the particular lock
to be created on that socket. create is TRUE if it is to be created
(as the Qt/Embedded server does), FALSE if it is expected to already
exist (as the Qt/Embedded client does).
QLock::~QLock ()
Destroys a lock
bool QLock::isValid () const
Returns true if the lock constructor was succesful, false if the lock
could not be created or was not available to connect to.
void QLock::lock ( Type t )
Locks the semaphore. Locks can either be Read or Write. If a lock is
Read, attempts to lock by other processes as Read will succeed, Write
attempts will block until the lock is unlocked. If locked as Write,
all attempts to lock by other processes will lock until the lock is
unlocked. Locks are recursive; that is a given QLock can be locked
multiple times by the same process without blocking, and will only be
unlocked after a corresponding number of unlock() calls.
bool QLock::locked () const
Returns true if the lock is currently held by the current process.
void QLock::unlock ()
Unlocks the semaphore. If other processes were blocking waiting to lock()
the semaphore, one of them will wake up and succeed in lock()ing.
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit,
copyright © 1995-2001
Trolltech, all rights reserved.
Copyright © 2001 Trolltech | Trademarks
| Qt version 3.0.0-beta1-beta1
|