<trbgcolor=#f0f0f0><td><b><ahref="tqvaluevector.html">TQValueVector</a></b><td>Value-based template class that provides a dynamic array
<trbgcolor=#f0f0f0><td><b><ahref="ntqvariant.html">TQVariant</a></b><td>Acts like a union for the most common TQt data types
<trbgcolor=#f0f0f0><td><b><ahref="ntqwmatrix.html">TQWMatrix</a></b><td>2D transformations of a coordinate system
<trbgcolor=#f0f0f0><td><b><ahref="ntqwaitcondition.html">TQWaitCondition</a></b><td>Allows waiting/waking for conditions between threads
<trbgcolor=#f0f0f0><td><b><ahref="tqwaitcondition.html">TQWaitCondition</a></b><td>Allows waiting/waking for conditions between threads
<trbgcolor=#f0f0f0><td><b><ahref="ntqwhatsthis.html">TQWhatsThis</a></b><td>Simple description of any widget, i.e. answering the question "What's this?"
<trbgcolor=#f0f0f0><td><b><ahref="qwheelevent.html">TQWheelEvent</a></b><td>Parameters that describe a wheel event
<trbgcolor=#f0f0f0><td><b><ahref="tqwidget.html">TQWidget</a></b><td>The base class of all user interface objects
@ -41,16 +41,16 @@ event handling, access to system settings, <a href="i18n.html#internationalizati
<trbgcolor=#f0f0f0><td><b><ahref="ntqevent.html">TQEvent</a></b><td>The base class of all event classes. Event objects contain event parameters
<trbgcolor=#f0f0f0><td><b><ahref="ntqfontdatabase.html">TQFontDatabase</a></b><td>Information about the fonts available in the underlying window system
<trbgcolor=#f0f0f0><td><b><ahref="qmimesourcefactory.html">TQMimeSourceFactory</a></b><td>Extensible provider of mime-typed data
<trbgcolor=#f0f0f0><td><b><ahref="ntqmutex.html">TQMutex</a></b><td>Access serialization between threads
<trbgcolor=#f0f0f0><td><b><ahref="qmutexlocker.html">TQMutexLocker</a></b><td>Simplifies locking and unlocking TQMutexes
<trbgcolor=#f0f0f0><td><b><ahref="tqmutex.html">TQMutex</a></b><td>Access serialization between threads
<trbgcolor=#f0f0f0><td><b><ahref="tqmutexlocker.html">TQMutexLocker</a></b><td>Simplifies locking and unlocking TQMutexes
<trbgcolor=#f0f0f0><td><b><ahref="ntqpixmapcache.html">TQPixmapCache</a></b><td>Application-global cache for pixmaps
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQMutex</h1>
<p>This is the complete list of member functions for
<ahref="ntqmutex.html">TQMutex</a>, including inherited members.
<ahref="tqmutex.html">TQMutex</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQMutexLocker</h1>
<p>This is the complete list of member functions for
<ahref="qmutexlocker.html">TQMutexLocker</a>, including inherited members.
<ahref="tqmutexlocker.html">TQMutexLocker</a>, including inherited members.
@ -182,25 +182,25 @@ for code that needs access to the mutex, such as
};
</pre>
<p><p>See also <ahref="ntqmutex.html">TQMutex</a>, <ahref="ntqwaitcondition.html">TQWaitCondition</a>, <ahref="environment.html">Environment Classes</a>, and <ahref="thread.html">Threading</a>.
<p><p>See also <ahref="tqmutex.html">TQMutex</a>, <ahref="tqwaitcondition.html">TQWaitCondition</a>, <ahref="environment.html">Environment Classes</a>, and <ahref="thread.html">Threading</a>.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQSemaphore</h1>
<p>This is the complete list of member functions for
<ahref="ntqsemaphore.html">TQSemaphore</a>, including inherited members.
<ahref="tqsemaphore.html">TQSemaphore</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQThread</h1>
<p>This is the complete list of member functions for
<ahref="ntqthread.html">TQThread</a>, including inherited members.
<ahref="tqthread.html">TQThread</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQThreadStorage</h1>
<p>This is the complete list of member functions for
<ahref="ntqthreadstorage.html">TQThreadStorage</a>, including inherited members.
<ahref="tqthreadstorage.html">TQThreadStorage</a>, including inherited members.
<tdalign="right"valign="center"><imgsrc="logo32.png"align="right"width="64"height="32"border="0"></td></tr></table><h1align=center>Complete Member List for TQWaitCondition</h1>
<p>This is the complete list of member functions for
<ahref="ntqwaitcondition.html">TQWaitCondition</a>, including inherited members.
<ahref="tqwaitcondition.html">TQWaitCondition</a>, including inherited members.
@ -324,7 +324,7 @@ It is safe to have multiple iterators at the same time. If some member of the ma
.PP
Since TQMap is value-based, there is no need to be concerned about deleting items in the map. The map holds its own copies and will free them if the corresponding member or the map itself is deleted.
.PP
TQMap is implicitly shared. This means you can just make copies of the map in time O(1). If multiple TQMap instances share the same data and one is modifying the map's data, this modifying instance makes a copy and modifies its private copy: so it does not affect other instances. If a TQMap is being used in a multi-threaded program, you must protect all access to the map. See QMutex.
TQMap is implicitly shared. This means you can just make copies of the map in time O(1). If multiple TQMap instances share the same data and one is modifying the map's data, this modifying instance makes a copy and modifies its private copy: so it does not affect other instances. If a TQMap is being used in a multi-threaded program, you must protect all access to the map. See TQMutex.
.PP
There are a couple of ways of inserting new items into the map. One uses the insert() method; the other uses operator[]:
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,19 +7,19 @@
.ad l
.nh
.SH NAME
QMutex \- Access serialization between threads
TQMutex \- Access serialization between threads
.SH SYNOPSIS
All the functions in this class are thread-safe when TQt is built with thread support.</p>
.PP
\fC#include <ntqmutex.h>\fR
\fC#include <tqmutex.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQMutex\fR ( bool recursive = FALSE )"
.BI "\fBTQMutex\fR ( bool recursive = FALSE )"
.br
.ti -1c
.BI "virtual \fB~QMutex\fR ()"
.BI "virtual \fB~TQMutex\fR ()"
.br
.ti -1c
.BI "void \fBlock\fR ()"
@ -35,9 +35,9 @@ All the functions in this class are thread-safe when TQt is built with thread su
.br
.in -1c
.SH DESCRIPTION
The QMutex class provides access serialization between threads.
The TQMutex class provides access serialization between threads.
.PP
The purpose of a QMutex is to protect an object, data structure or section of code so that only one thread can access it at a time (This is similar to the Java \fCsynchronized\fR keyword). For example, say there is a method which prints a message to the user on two lines:
The purpose of a TQMutex is to protect an object, data structure or section of code so that only one thread can access it at a time (This is similar to the Java \fCsynchronized\fR keyword). For example, say there is a method which prints a message to the user on two lines:
.PP
.nf
.br
@ -118,7 +118,7 @@ If we add a mutex, we should get the result we want:
.PP
.nf
.br
QMutex mutex;
TQMutex mutex;
.br
int number = 6;
.br
@ -160,35 +160,35 @@ When you call lock() in a thread, other threads that try to call lock() in the s
.PP
See also Environment Classes and Threading.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QMutex::QMutex ( bool recursive = FALSE )"
.SH "TQMutex::TQMutex ( bool recursive = FALSE )"
Constructs a new mutex. The mutex is created in an unlocked state. A recursive mutex is created if \fIrecursive\fR is TRUE; a normal mutex is created if \fIrecursive\fR is FALSE (the default). With a recursive mutex, a thread can lock the same mutex multiple times and it will not be unlocked until a corresponding number of unlock() calls have been made.
.SH "QMutex::~QMutex ()\fC [virtual]\fR"
.SH "TQMutex::~TQMutex ()\fC [virtual]\fR"
Destroys the mutex.
.PP
\fBWarning:\fR If you destroy a mutex that still holds a lock the resultant behavior is undefined.
.SH "void QMutex::lock ()"
.SH "void TQMutex::lock ()"
Attempt to lock the mutex. If another thread has locked the mutex then this call will \fIblock\fR until that thread has unlocked it.
.PP
See also unlock() and locked().
.SH "bool QMutex::locked ()"
.SH "bool TQMutex::locked ()"
Returns TRUE if the mutex is locked by another thread; otherwise returns FALSE.
.PP
\fBWarning:\fR Due to differing implementations of recursive mutexes on various platforms, calling this function from the same thread that previously locked the mutex will return undefined results.
.PP
See also lock() and unlock().
.SH "bool QMutex::tryLock ()"
.SH "bool TQMutex::tryLock ()"
Attempt to lock the mutex. If the lock was obtained, this function returns TRUE. If another thread has locked the mutex, this function returns FALSE, instead of waiting for the mutex to become available, i.e. it does not block.
.PP
If the lock was obtained, the mutex must be unlocked with unlock() before another thread can successfully lock it.
.PP
See also lock(), unlock(), and locked().
.SH "void QMutex::unlock ()"
.SH "void TQMutex::unlock ()"
Unlocks the mutex. Attempting to unlock a mutex in a different thread to the one that locked it results in an error. Unlocking a mutex that is not locked results in undefined behaviour (varies between different Operating Systems' thread implementations).
.PP
See also lock() and locked().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqmutex.html
.BR http://doc.trolltech.com/tqmutex.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,32 +7,32 @@
.ad l
.nh
.SH NAME
QMutexLocker \- Simplifies locking and unlocking QMutexes
TQMutexLocker \- Simplifies locking and unlocking TQMutexes
.SH SYNOPSIS
All the functions in this class are thread-safe when TQt is built with thread support.</p>
.PP
\fC#include <ntqmutex.h>\fR
\fC#include <tqmutex.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQMutexLocker\fR ( QMutex * mutex )"
.BI "\fBTQMutexLocker\fR ( TQMutex * mutex )"
.br
.ti -1c
.BI "\fB~QMutexLocker\fR ()"
.BI "\fB~TQMutexLocker\fR ()"
.br
.ti -1c
.BI "QMutex * \fBmutex\fR () const"
.BI "TQMutex * \fBmutex\fR () const"
.br
.in -1c
.SH DESCRIPTION
The QMutexLocker class simplifies locking and unlocking QMutexes.
The TQMutexLocker class simplifies locking and unlocking TQMutexes.
.PP
The purpose of QMutexLocker is to simplify QMutex locking and unlocking. Locking and unlocking a QMutex in complex functions and statements or in exception handling code is error prone and difficult to debug. QMutexLocker should be used in such situations to ensure that the state of the mutex is well defined and always locked and unlocked properly.
The purpose of TQMutexLocker is to simplify TQMutex locking and unlocking. Locking and unlocking a TQMutex in complex functions and statements or in exception handling code is error prone and difficult to debug. TQMutexLocker should be used in such situations to ensure that the state of the mutex is well defined and always locked and unlocked properly.
.PP
QMutexLocker should be created within a function where a QMutex needs to be locked. The mutex is locked when QMutexLocker is created, and unlocked when QMutexLocker is destroyed.
TQMutexLocker should be created within a function where a TQMutex needs to be locked. The mutex is locked when TQMutexLocker is created, and unlocked when TQMutexLocker is destroyed.
.PP
For example, this complex function locks a QMutex upon entering the function and unlocks the mutex at all the exit points:
For example, this complex function locks a TQMutex upon entering the function and unlocks the mutex at all the exit points:
.PP
.nf
.br
@ -111,7 +111,7 @@ For example, this complex function locks a QMutex upon entering the function and
.PP
This example function will get more complicated as it is developed, which increases the likelihood that errors will occur.
.PP
Using QMutexLocker greatly simplifies the code, and makes it more readable:
Using TQMutexLocker greatly simplifies the code, and makes it more readable:
.PP
.nf
.br
@ -119,7 +119,7 @@ Using QMutexLocker greatly simplifies the code, and makes it more readable:
.br
{
.br
QMutexLocker locker( &mutex );
TQMutexLocker locker( &mutex );
.br
.br
int return_value = 0;
@ -176,11 +176,11 @@ Using QMutexLocker greatly simplifies the code, and makes it more readable:
.br
.fi
.PP
Now, the mutex will always be unlocked when the QMutexLocker object is destroyed (when the function returns since \fClocker\fR is an auto variable). Note that the mutex will be unlocked after the call to moreComplexFunction() in this example, avoiding possible bugs caused by unlocking the mutex too early, as in the first example.
Now, the mutex will always be unlocked when the TQMutexLocker object is destroyed (when the function returns since \fClocker\fR is an auto variable). Note that the mutex will be unlocked after the call to moreComplexFunction() in this example, avoiding possible bugs caused by unlocking the mutex too early, as in the first example.
.PP
The same principle applies to code that throws and catches exceptions. An exception that is not caught in the function that has locked the mutex has no way of unlocking the mutex before the exception is passed up the stack to the calling function.
.PP
QMutexLocker also provides a mutex() member function that returns the mutex on which the QMutexLocker is operating. This is useful for code that needs access to the mutex, such as QWaitCondition::wait(). For example:
TQMutexLocker also provides a mutex() member function that returns the mutex on which the TQMutexLocker is operating. This is useful for code that needs access to the mutex, such as TQWaitCondition::wait(). For example:
.PP
.nf
.br
@ -190,12 +190,12 @@ QMutexLocker also provides a mutex() member function that returns the mutex on w
.br
private:
.br
QMutexLocker locker;
TQMutexLocker locker;
.br
.br
public:
.br
SignalWaiter( QMutex *mutex )
SignalWaiter( TQMutex *mutex )
.br
: locker( mutex )
.br
@ -232,23 +232,23 @@ QMutexLocker also provides a mutex() member function that returns the mutex on w
.br
.fi
.PP
See also QMutex, QWaitCondition, Environment Classes, and Threading.
See also TQMutex, TQWaitCondition, Environment Classes, and Threading.
Constructs a QMutexLocker and locks \fImutex\fR. The mutex will be unlocked when the QMutexLocker is destroyed. If \fImutex\fR is zero, QMutexLocker does nothing.
Constructs a TQMutexLocker and locks \fImutex\fR. The mutex will be unlocked when the TQMutexLocker is destroyed. If \fImutex\fR is zero, TQMutexLocker does nothing.
.PP
See also QMutex::lock().
.SH "QMutexLocker::~QMutexLocker ()"
Destroys the QMutexLocker and unlocks the mutex which was locked in the constructor.
See also TQMutex::lock().
.SH "TQMutexLocker::~TQMutexLocker ()"
Destroys the TQMutexLocker and unlocks the mutex which was locked in the constructor.
.PP
See also QMutexLocker::QMutexLocker() and QMutex::unlock().
.SH "QMutex * QMutexLocker::mutex () const"
See also TQMutexLocker::TQMutexLocker() and TQMutex::unlock().
.SH "TQMutex * TQMutexLocker::mutex () const"
Returns a pointer to the mutex which was locked in the constructor.
.PP
See also QMutexLocker::QMutexLocker().
See also TQMutexLocker::TQMutexLocker().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qmutexlocker.html
.BR http://doc.trolltech.com/tqmutexlocker.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
@ -124,7 +124,7 @@ We present a very brief introduction to regexps, a description of Qt's regexp la
.PP
Experienced regexp users may prefer to skip the introduction and go directly to the relevant information.
.PP
In case of multi-threaded programming, note that QRegExp depends on QThreadStorage internally. For that reason, QRegExp should only be used with threads started with QThread, i.e. not with threads started with platform-specific APIs.
In case of multi-threaded programming, note that QRegExp depends on TQThreadStorage internally. For that reason, QRegExp should only be used with threads started with TQThread, i.e. not with threads started with platform-specific APIs.
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,19 +7,19 @@
.ad l
.nh
.SH NAME
QSemaphore \- Robust integer semaphore
TQSemaphore \- Robust integer semaphore
.SH SYNOPSIS
All the functions in this class are thread-safe when TQt is built with thread support.</p>
.PP
\fC#include <ntqsemaphore.h>\fR
\fC#include <tqsemaphore.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQSemaphore\fR ( int maxcount )"
.BI "\fBTQSemaphore\fR ( int maxcount )"
.br
.ti -1c
.BI "virtual \fB~QSemaphore\fR ()"
.BI "virtual \fB~TQSemaphore\fR ()"
.br
.ti -1c
.BI "int \fBavailable\fR () const"
@ -44,9 +44,9 @@ All the functions in this class are thread-safe when TQt is built with thread su
.br
.in -1c
.SH DESCRIPTION
The QSemaphore class provides a robust integer semaphore.
The TQSemaphore class provides a robust integer semaphore.
.PP
A QSemaphore can be used to serialize thread execution, in a similar way to a QMutex. A semaphore differs from a mutex, in that a semaphore can be accessed by more than one thread at a time.
A TQSemaphore can be used to serialize thread execution, in a similar way to a TQMutex. A semaphore differs from a mutex, in that a semaphore can be accessed by more than one thread at a time.
.PP
For example, suppose we have an application that stores data in a large tree structure. The application creates 10 threads (commonly called a thread pool) to perform searches on the tree. When the application searches the tree for some piece of data, it uses one thread per base node to do the searching. A semaphore could be used to make sure that two threads don't try to search the same branch of the tree at the same time.
.PP
@ -56,36 +56,36 @@ When a semaphore is created it is given a number which is the maximum number of
.PP
See also Environment Classes and Threading.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QSemaphore::QSemaphore ( int maxcount )"
.SH "TQSemaphore::TQSemaphore ( int maxcount )"
Creates a new semaphore. The semaphore can be concurrently accessed at most \fImaxcount\fR times.
\fBWarning:\fR If you destroy a semaphore that has accesses in use the resultant behavior is undefined.
.SH "int QSemaphore::available () const"
.SH "int TQSemaphore::available () const"
Returns the number of accesses currently available to the semaphore.
.SH "int QSemaphore::operator++ ( int )"
.SH "int TQSemaphore::operator++ ( int )"
Postfix ++ operator.
.PP
Try to get access to the semaphore. If available() == 0, this call will block until it can get access, i.e. until available() > 0.
.SH "int QSemaphore::operator+= ( int n )"
.SH "int TQSemaphore::operator+= ( int n )"
Try to get access to the semaphore. If available() < \fIn\fR, this call will block until it can get all the accesses it wants, i.e. until available() >= \fIn\fR.
.SH "int QSemaphore::operator-- ( int )"
.SH "int TQSemaphore::operator-- ( int )"
Postfix -- operator.
.PP
Release access of the semaphore. This wakes all threads waiting for access to the semaphore.
.SH "int QSemaphore::operator-= ( int n )"
.SH "int TQSemaphore::operator-= ( int n )"
Release \fIn\fR accesses to the semaphore.
.SH "int QSemaphore::total () const"
.SH "int TQSemaphore::total () const"
Returns the total number of accesses to the semaphore.
.SH "bool QSemaphore::tryAccess ( int n )"
.SH "bool TQSemaphore::tryAccess ( int n )"
Try to get access to the semaphore. If available() < \fIn\fR, this
function will return FALSE immediately. If available() >= \fIn\fR,
this function will take \fIn\fR accesses and return TRUE. This
function does \fInot\fR block.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqsemaphore.html
.BR http://doc.trolltech.com/tqsemaphore.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,21 +7,21 @@
.ad l
.nh
.SH NAME
QThread \- Platform-independent threads
TQThread \- Platform-independent threads
.SH SYNOPSIS
All the functions in this class are thread-safe when TQt is built with thread support.</p>
.PP
\fC#include <ntqthread.h>\fR
\fC#include <tqthread.h>\fR
.PP
Inherits Qt.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQThread\fR ( unsigned int stackSize = 0 )"
.BI "\fBTQThread\fR ( unsigned int stackSize = 0 )"
.br
.ti -1c
.BI "virtual \fB~QThread\fR ()"
.BI "virtual \fB~TQThread\fR ()"
.br
.ti -1c
.BI "bool \fBwait\fR ( unsigned long time = ULONG_MAX )"
@ -70,13 +70,13 @@ Inherits Qt.
.br
.in -1c
.SH DESCRIPTION
The QThread class provides platform-independent threads.
The TQThread class provides platform-independent threads.
.PP
A QThread represents a separate thread of control within the program; it shares data with all the other threads within the process but executes independently in the way that a separate program does on a multitasking operating system. Instead of starting in main(), QThreads begin executing in run(). You inherit run() to include your code. For example:
A TQThread represents a separate thread of control within the program; it shares data with all the other threads within the process but executes independently in the way that a separate program does on a multitasking operating system. Instead of starting in main(), TQThreads begin executing in run(). You inherit run() to include your code. For example:
.PP
.nf
.br
class MyThread : public QThread {
class MyThread : public TQThread {
.br
.br
public:
@ -127,78 +127,78 @@ This will start two threads, each of which writes Ping! 20 times to the screen a
.PP
See also Thread Support in Qt, Environment Classes, and Threading.
.SS "Member Type Documentation"
.SH "QThread::Priority"
.SH "TQThread::Priority"
This enum type indicates how the operating system should schedule newly created threads.
.TP
\fCQThread::IdlePriority\fR - scheduled only when no other threads are running.
\fCTQThread::IdlePriority\fR - scheduled only when no other threads are running.
.TP
\fCQThread::LowestPriority\fR - scheduled less often than LowPriority.
\fCTQThread::LowestPriority\fR - scheduled less often than LowPriority.
.TP
\fCQThread::LowPriority\fR - scheduled less often than NormalPriority.
\fCTQThread::LowPriority\fR - scheduled less often than NormalPriority.
.TP
\fCQThread::NormalPriority\fR - the default priority of the operating system.
\fCTQThread::NormalPriority\fR - the default priority of the operating system.
.TP
\fCQThread::HighPriority\fR - scheduled more often than NormalPriority.
\fCTQThread::HighPriority\fR - scheduled more often than NormalPriority.
.TP
\fCQThread::HighestPriority\fR - scheduled more often then HighPriority.
\fCTQThread::HighestPriority\fR - scheduled more often then HighPriority.
.TP
\fCQThread::TimeCriticalPriority\fR - scheduled as often as possible.
\fCTQThread::TimeCriticalPriority\fR - scheduled as often as possible.
.TP
\fCQThread::InheritPriority\fR - use the same priority as the creating thread. This is the default.
\fCTQThread::InheritPriority\fR - use the same priority as the creating thread. This is the default.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QThread::QThread ( unsigned int stackSize = 0 )"
.SH "TQThread::TQThread ( unsigned int stackSize = 0 )"
Constructs a new thread. The thread does not begin executing until start() is called.
.PP
If \fIstackSize\fR is greater than zero, the maximum stack size is set to \fIstackSize\fR bytes, otherwise the maximum stack size is automatically determined by the operating system.
.PP
\fBWarning:\fR Most operating systems place minimum and maximum limits on thread stack sizes. The thread will fail to start if the stack size is outside these limits.
.SH "QThread::~QThread ()\fC [virtual]\fR"
QThread destructor.
.SH "TQThread::~TQThread ()\fC [virtual]\fR"
TQThread destructor.
.PP
Note that deleting a QThread object will not stop the execution of the thread it represents. Deleting a running QThread (i.e. finished() returns FALSE) will probably result in a program crash. You can wait() on a thread to make sure that it has finished.
Note that deleting a TQThread object will not stop the execution of the thread it represents. Deleting a running TQThread (i.e. finished() returns FALSE) will probably result in a program crash. You can wait() on a thread to make sure that it has finished.
This returns the thread handle of the currently executing thread.
.PP
\fBWarning:\fR The handle returned by this function is used for internal purposes and should \fInot\fR be used in any application code. On Windows, the returned value is a pseudo handle for the current thread, and it cannot be used for numerical comparison.
.SH "void QThread::exit ()\fC [static]\fR"
.SH "void TQThread::exit ()\fC [static]\fR"
Ends the execution of the calling thread and wakes up any threads waiting for its termination.
.SH "bool QThread::finished () const"
.SH "bool TQThread::finished () const"
Returns TRUE if the thread is finished; otherwise returns FALSE.
.SH "void QThread::msleep ( unsigned long msecs )\fC [static protected]\fR"
.SH "void TQThread::msleep ( unsigned long msecs )\fC [static protected]\fR"
System independent sleep. This causes the current thread to sleep for \fImsecs\fR milliseconds
This method is pure virtual, and must be implemented in derived classes in order to do useful work. Returning from this method will end the execution of the thread.
.PP
See also wait().
.SH "bool QThread::running () const"
.SH "bool TQThread::running () const"
Returns TRUE if the thread is running; otherwise returns FALSE.
.SH "void QThread::sleep ( unsigned long secs )\fC [static protected]\fR"
.SH "void TQThread::sleep ( unsigned long secs )\fC [static protected]\fR"
System independent sleep. This causes the current thread to sleep for \fIsecs\fR seconds.
Begins execution of the thread by calling run(), which should be reimplemented in a QThread subclass to contain your code. The operating system will schedule the thread according to the \fIpriority\fR argument.
Begins execution of the thread by calling run(), which should be reimplemented in a TQThread subclass to contain your code. The operating system will schedule the thread according to the \fIpriority\fR argument.
.PP
If you try to start a thread that is already running, this function will wait until the the thread has finished and then restart the thread.
.PP
See also Priority.
.SH "void QThread::terminate ()"
This function terminates the execution of the thread. The thread may or may not be terminated immediately, depending on the operating system's scheduling policies. Use QThread::wait() after terminate() for synchronous termination.
.SH "void TQThread::terminate ()"
This function terminates the execution of the thread. The thread may or may not be terminated immediately, depending on the operating system's scheduling policies. Use TQThread::wait() after terminate() for synchronous termination.
.PP
When the thread is terminated, all threads waiting for the the thread to finish will be woken up.
.PP
\fBWarning:\fR This function is dangerous, and its use is discouraged. The thread can be terminated at any point in its code path. Threads can be terminated while modifying data. There is no chance for the thread to cleanup after itself, unlock any held mutexes, etc. In short, use this function only if \fIabsolutely\fR necessary.
.SH "void QThread::usleep ( unsigned long usecs )\fC [static protected]\fR"
.SH "void TQThread::usleep ( unsigned long usecs )\fC [static protected]\fR"
System independent sleep. This causes the current thread to sleep for \fIusecs\fR microseconds
.SH "bool QThread::wait ( unsigned long time = ULONG_MAX )"
.SH "bool TQThread::wait ( unsigned long time = ULONG_MAX )"
A thread calling this function will block until either of these conditions is met:
.TP
The thread associated with this QThread object has finished execution (i.e. when it returns from run()). This function will return TRUE if the thread has finished. It also returns TRUE if the thread has not been started yet.
The thread associated with this TQThread object has finished execution (i.e. when it returns from run()). This function will return TRUE if the thread has finished. It also returns TRUE if the thread has not been started yet.
.TP
\fItime\fR milliseconds has elapsed. If \fItime\fR is ULONG_MAX (the default), then the wait will never timeout (the thread must return from run()). This function will return FALSE if the wait timed out.
.PP
This provides similar functionality to the POSIX \fCpthread_join()\fR function.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqthread.html
.BR http://doc.trolltech.com/tqthread.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,19 +7,19 @@
.ad l
.nh
.SH NAME
QThreadStorage \- Per-thread data storage
TQThreadStorage \- Per-thread data storage
.SH SYNOPSIS
All the functions in this class are thread-safe when TQt is built with thread support.</p>
.PP
\fC#include <ntqthreadstorage.h>\fR
\fC#include <tqthreadstorage.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQThreadStorage\fR ()"
.BI "\fBTQThreadStorage\fR ()"
.br
.ti -1c
.BI "\fB~QThreadStorage\fR ()"
.BI "\fB~TQThreadStorage\fR ()"
.br
.ti -1c
.BI "bool \fBhasLocalData\fR () const"
@ -35,21 +35,21 @@ All the functions in this class are thread-safe when TQt is built with thread su
.br
.in -1c
.SH DESCRIPTION
The QThreadStorage class provides per-thread data storage.
The TQThreadStorage class provides per-thread data storage.
.PP
QThreadStorage is a template class that provides per-thread data storage.
TQThreadStorage is a template class that provides per-thread data storage.
.PP
\fINote that due to compiler limitations, QThreadStorage can only store pointers.\fR
\fINote that due to compiler limitations, TQThreadStorage can only store pointers.\fR
.PP
The setLocalData() function stores a single thread-specific value for the calling thread. The data can be accessed later using the localData() functions. QThreadStorage takes ownership of the data (which must be created on the heap with \fInew\fR) and deletes it when the thread exits (either normally or via termination).
The setLocalData() function stores a single thread-specific value for the calling thread. The data can be accessed later using the localData() functions. TQThreadStorage takes ownership of the data (which must be created on the heap with \fInew\fR) and deletes it when the thread exits (either normally or via termination).
.PP
The hasLocalData() function allows the programmer to determine if data has previously been set using the setLocalData() function. This is useful for lazy initializiation.
.PP
For example, the following code uses QThreadStorage to store a single cache for each thread that calls the \fIcacheObject()\fR and \fIremoveFromCache()\fR functions. The cache is automatically deleted when the calling thread exits (either normally or via termination).
For example, the following code uses TQThreadStorage to store a single cache for each thread that calls the \fIcacheObject()\fR and \fIremoveFromCache()\fR functions. The cache is automatically deleted when the calling thread exits (either normally or via termination).
@ -83,65 +83,65 @@ For example, the following code uses QThreadStorage to store a single cache for
.SH "Caveats"
.IP
.TP
As noted above, QThreadStorage can only store pointers due to compiler limitations. Support for value-based objects will be added when the majority of compilers are able to support partial template specialization.
As noted above, TQThreadStorage can only store pointers due to compiler limitations. Support for value-based objects will be added when the majority of compilers are able to support partial template specialization.
.IP
.TP
The destructor does \fInot\fR delete per-thread data. QThreadStorage only deletes per-thread data when the thread exits or when setLocalData() is called multiple times.
The destructor does \fInot\fR delete per-thread data. TQThreadStorage only deletes per-thread data when the thread exits or when setLocalData() is called multiple times.
.IP
.TP
QThreadStorage can only be used with threads started with QThread. It \fIcannot\fR be used with threads started with platform-specific APIs.
TQThreadStorage can only be used with threads started with TQThread. It \fIcannot\fR be used with threads started with platform-specific APIs.
.IP
.TP
As a corollary to the above, platform-specific APIs cannot be used to exit or terminate a QThread using QThreadStorage. Doing so will cause all per-thread data to be leaked. See QThread::exit() and QThread::terminate().
As a corollary to the above, platform-specific APIs cannot be used to exit or terminate a TQThread using TQThreadStorage. Doing so will cause all per-thread data to be leaked. See TQThread::exit() and TQThread::terminate().
.IP
.TP
QThreadStorage \fIcan\fR be used to store data for the \fImain()\fR thread \fIafter\fR QApplication has been constructed. QThreadStorage deletes all data set for the \fImain()\fR thread when QApplication is destroyed, regardless of whether or not the \fImain()\fR thread has actually finished.
TQThreadStorage \fIcan\fR be used to store data for the \fImain()\fR thread \fIafter\fR QApplication has been constructed. TQThreadStorage deletes all data set for the \fImain()\fR thread when QApplication is destroyed, regardless of whether or not the \fImain()\fR thread has actually finished.
.IP
.TP
The implementation of QThreadStorage limits the total number of QThreadStorage objects to 256. An unlimited number of threads can store per-thread data in each QThreadStorage object.
The implementation of TQThreadStorage limits the total number of TQThreadStorage objects to 256. An unlimited number of threads can store per-thread data in each TQThreadStorage object.
.IP
.PP
See also Environment Classes and Threading.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QThreadStorage::QThreadStorage ()"
.SH "TQThreadStorage::TQThreadStorage ()"
Constructs a new per-thread data storage object.
.SH "QThreadStorage::~QThreadStorage ()"
.SH "TQThreadStorage::~TQThreadStorage ()"
Destroys the per-thread data storage object.
.PP
Note: The per-thread data stored is \fInot\fR deleted. Any data left in QThreadStorage is leaked. Make sure that all threads using QThreadStorage have exited before deleting the QThreadStorage.
Note: The per-thread data stored is \fInot\fR deleted. Any data left in TQThreadStorage is leaked. Make sure that all threads using TQThreadStorage have exited before deleting the TQThreadStorage.
.PP
See also hasLocalData().
.SH "bool QThreadStorage::hasLocalData () const"
.SH "bool TQThreadStorage::hasLocalData () const"
Returns TRUE if the calling thread has non-zero data available; otherwise returns FALSE.
.PP
See also localData().
.SH "T & QThreadStorage::localData ()"
.SH "T & TQThreadStorage::localData ()"
Returns a reference to the data that was set by the calling thread.
.PP
Note: QThreadStorage can only store pointers. This function returns a \fIreference\fR to the pointer that was set by the calling thread. The value of this reference is 0 if no data was set by the calling thread,
Note: TQThreadStorage can only store pointers. This function returns a \fIreference\fR to the pointer that was set by the calling thread. The value of this reference is 0 if no data was set by the calling thread,
.PP
See also hasLocalData().
.SH "T QThreadStorage::localData () const"
.SH "T TQThreadStorage::localData () const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns a copy of the data that was set by the calling thread.
.PP
Note: QThreadStorage can only store pointers. This function returns a pointer to the data that was set by the calling thread. If no data was set by the calling thread, this function returns 0.
Note: TQThreadStorage can only store pointers. This function returns a pointer to the data that was set by the calling thread. If no data was set by the calling thread, this function returns 0.
.PP
See also hasLocalData().
.SH "void QThreadStorage::setLocalData ( T data )"
.SH "void TQThreadStorage::setLocalData ( T data )"
Sets the local data for the calling thread to \fIdata\fR. It can be accessed later using the localData() functions.
.PP
If \fIdata\fR is 0, this function deletes the previous data (if any) and returns immediately.
.PP
If \fIdata\fR is non-zero, QThreadStorage takes ownership of the \fIdata\fR and deletes it automatically either when the thread exits (either normally or via termination) or when setLocalData() is called again.
If \fIdata\fR is non-zero, TQThreadStorage takes ownership of the \fIdata\fR and deletes it automatically either when the thread exits (either normally or via termination) or when setLocalData() is called again.
.PP
Note: QThreadStorage can only store pointers. The \fIdata\fR argument must be either a pointer to an object created on the heap (i.e. using \fInew\fR) or 0. You should not delete \fIdata\fR yourself; QThreadStorage takes ownership and will delete the \fIdata\fR itself.
Note: TQThreadStorage can only store pointers. The \fIdata\fR argument must be either a pointer to an object created on the heap (i.e. using \fInew\fR) or 0. You should not delete \fIdata\fR yourself; TQThreadStorage takes ownership and will delete the \fIdata\fR itself.
@ -383,7 +383,7 @@ It is safe to have multiple iterators a the list at the same time. If some membe
.PP
Because TQValueList is value-based there is no need to be careful about deleting items in the list. The list holds its own copies and will free them if the corresponding member or the list itself is deleted. You can force the list to free all of its items with clear().
.PP
TQValueList is shared implicitly, which means it can be copied in constant time, i.e. O(1). If multiple TQValueList instances share the same data and one needs to modify its contents, this modifying instance makes a copy and modifies its private copy; therefore it does not affect the other instances; this takes O(n) time. This is often called "copy on write". If a TQValueList is being used in a multi-threaded program, you must protect all access to the list. See QMutex.
TQValueList is shared implicitly, which means it can be copied in constant time, i.e. O(1). If multiple TQValueList instances share the same data and one needs to modify its contents, this modifying instance makes a copy and modifies its private copy; therefore it does not affect the other instances; this takes O(n) time. This is often called "copy on write". If a TQValueList is being used in a multi-threaded program, you must protect all access to the list. See TQMutex.
.PP
There are several ways to insert items into the list. The prepend() and append() functions insert items at the beginning and the end of the list respectively. The insert() function comes in several flavors and can be used to add one or more items at specific positions within the list.
@ -395,7 +395,7 @@ By creating a TQValueVector with a sufficiently large initial size, there will b
.PP
Because TQValueVector is value-based there is no need to be careful about deleting elements in the vector. The vector holds its own copies and will free them if the corresponding member or the vector itself is deleted. You can force the vector to free all of its items with clear().
.PP
TQValueVector is shared implicitly, which means it can be copied in constant time. If multiple TQValueVector instances share the same data and one needs to modify its contents, this modifying instance makes a copy and modifies its private copy; it thus does not affect the other instances. This is often called "copy on write". If a TQValueVector is being used in a multi-threaded program, you must protect all access to the vector. See QMutex.
TQValueVector is shared implicitly, which means it can be copied in constant time. If multiple TQValueVector instances share the same data and one needs to modify its contents, this modifying instance makes a copy and modifies its private copy; it thus does not affect the other instances. This is often called "copy on write". If a TQValueVector is being used in a multi-threaded program, you must protect all access to the vector. See TQMutex.
.PP
There are several ways to insert elements into the vector. The push_back() function insert elements into the end of the vector, and is usually fastest. The insert() function can be used to add elements at specific positions within the vector.
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
@ -7,25 +7,25 @@
.ad l
.nh
.SH NAME
QWaitCondition \- Allows waiting/waking for conditions between threads
TQWaitCondition \- Allows waiting/waking for conditions between threads
.SH SYNOPSIS
All the functions in this class are thread-safe when TQt is built with thread support.</p>
.PP
\fC#include <ntqwaitcondition.h>\fR
\fC#include <tqwaitcondition.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQWaitCondition\fR ()"
.BI "\fBTQWaitCondition\fR ()"
.br
.ti -1c
.BI "virtual \fB~QWaitCondition\fR ()"
.BI "virtual \fB~TQWaitCondition\fR ()"
.br
.ti -1c
.BI "bool \fBwait\fR ( unsigned long time = ULONG_MAX )"
.br
.ti -1c
.BI "bool \fBwait\fR ( QMutex * mutex, unsigned long time = ULONG_MAX )"
.BI "bool \fBwait\fR ( TQMutex * mutex, unsigned long time = ULONG_MAX )"
.br
.ti -1c
.BI "void \fBwakeOne\fR ()"
@ -35,18 +35,18 @@ All the functions in this class are thread-safe when TQt is built with thread su
.br
.in -1c
.SH DESCRIPTION
The QWaitCondition class allows waiting/waking for conditions between threads.
The TQWaitCondition class allows waiting/waking for conditions between threads.
.PP
QWaitConditions allow a thread to tell other threads that some sort of condition has been met; one or many threads can block waiting for a QWaitCondition to set a condition with wakeOne() or wakeAll(). Use wakeOne() to wake one randomly selected event or wakeAll() to wake them all. For example, say we have three tasks that should be performed every time the user presses a key; each task could be split into a thread, each of which would have a run() body like this:
TQWaitConditions allow a thread to tell other threads that some sort of condition has been met; one or many threads can block waiting for a TQWaitCondition to set a condition with wakeOne() or wakeAll(). Use wakeOne() to wake one randomly selected event or wakeAll() to wake them all. For example, say we have three tasks that should be performed every time the user presses a key; each task could be split into a thread, each of which would have a run() body like this:
.PP
.nf
.br
QWaitCondition key_pressed;
TQWaitCondition key_pressed;
.br
.br
for (;;) {
.br
key_pressed.wait(); // This is a QWaitCondition global variable
key_pressed.wait(); // This is a TQWaitCondition global variable
.br
// Key was pressed, do something interesting
.br
@ -60,7 +60,7 @@ A fourth thread would read key presses and wake the other three threads up every
.PP
.nf
.br
QWaitCondition key_pressed;
TQWaitCondition key_pressed;
.br
.br
for (;;) {
@ -81,9 +81,9 @@ Note that the order the three threads are woken up in is undefined, and that if
.PP
.nf
.br
QMutex mymutex;
TQMutex mymutex;
.br
QWaitCondition key_pressed;
TQWaitCondition key_pressed;
.br
int mycount=0;
.br
@ -92,7 +92,7 @@ Note that the order the three threads are woken up in is undefined, and that if
.br
for (;;) {
.br
key_pressed.wait(); // This is a QWaitCondition global variable
key_pressed.wait(); // This is a TQWaitCondition global variable
.br
mymutex.lock();
.br
@ -143,11 +143,11 @@ The mutexes are necessary because the results of two threads attempting to chang
.PP
See also Environment Classes and Threading.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QWaitCondition::QWaitCondition ()"
.SH "TQWaitCondition::TQWaitCondition ()"
Constructs a new event signalling, i.e. wait condition, object.
Deletes the event signalling, i.e. wait condition, object.
.SH "bool QWaitCondition::wait ( unsigned long time = ULONG_MAX )"
.SH "bool TQWaitCondition::wait ( unsigned long time = ULONG_MAX )"
Wait on the thread event object. The thread calling this will block until either of these conditions is met:
.TP
Another thread signals it using wakeOne() or wakeAll(). This function will return TRUE in this case.
@ -155,7 +155,7 @@ Another thread signals it using wakeOne() or wakeAll(). This function will retur
\fItime\fR milliseconds has elapsed. If \fItime\fR is ULONG_MAX (the default), then the wait will never timeout (the event must be signalled). This function will return FALSE if the wait timed out.
.PP
See also wakeOne() and wakeAll().
.SH "bool QWaitCondition::wait ( QMutex * mutex, unsigned long time = ULONG_MAX )"
.SH "bool TQWaitCondition::wait ( TQMutex * mutex, unsigned long time = ULONG_MAX )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Release the locked \fImutex\fR and wait on the thread event object. The \fImutex\fR must be initially locked by the calling thread. If \fImutex\fR is not in a locked state, this function returns immediately. If \fImutex\fR is a recursive mutex, this function returns immediately. The \fImutex\fR will be unlocked, and the calling thread will block until either of these conditions is met:
@ -167,17 +167,17 @@ Another thread signals it using wakeOne() or wakeAll(). This function will retur
The mutex will be returned to the same locked state. This function is provided to allow the atomic transition from the locked state to the wait state.
.PP
See also wakeOne() and wakeAll().
.SH "void QWaitCondition::wakeAll ()"
This wakes all threads waiting on the QWaitCondition. The order in which the threads are woken up depends on the operating system's scheduling policies, and cannot be controlled or predicted.
.SH "void TQWaitCondition::wakeAll ()"
This wakes all threads waiting on the TQWaitCondition. The order in which the threads are woken up depends on the operating system's scheduling policies, and cannot be controlled or predicted.
.PP
See also wakeOne().
.SH "void QWaitCondition::wakeOne ()"
This wakes one thread waiting on the QWaitCondition. The thread that is woken up depends on the operating system's scheduling policies, and cannot be controlled or predicted.
.SH "void TQWaitCondition::wakeOne ()"
This wakes one thread waiting on the TQWaitCondition. The thread that is woken up depends on the operating system's scheduling policies, and cannot be controlled or predicted.