Revert "QT_THREAD_SUPPORT -> TQT_THREAD_SUPPORT conversion to align to updated admin module"

The original commit was a mistake and should not have been pushed.

This reverts commit f849f22528.
pull/2/head
Michele Calgaro 6 years ago
parent f849f22528
commit 2df70f03d4

@ -94,9 +94,9 @@ class QEventLoop;
class QWSDecoration; class QWSDecoration;
#endif #endif
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
class QMutex; class QMutex;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
class QApplication; class QApplication;
@ -316,7 +316,7 @@ public:
static bool x11_apply_settings(); static bool x11_apply_settings();
#endif #endif
void wakeUpGuiThread(); void wakeUpGuiThread();
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
void lock(); void lock();
void unlock(bool wakeUpGui = TRUE); void unlock(bool wakeUpGui = TRUE);
bool locked(); bool locked();
@ -367,9 +367,9 @@ private:
friend void qt_init(int *, char **, QApplication::Type); friend void qt_init(int *, char **, QApplication::Type);
#endif #endif
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
static QMutex *qt_mutex; static QMutex *qt_mutex;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
int app_argc; int app_argc;
char **app_argv; char **app_argv;

@ -88,9 +88,9 @@ struct timeval; //stdc struct
struct TimerInfo; //internal structure (qeventloop_mac.cpp) struct TimerInfo; //internal structure (qeventloop_mac.cpp)
#endif #endif
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
class QMutex; class QMutex;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
class Q_EXPORT QEventLoop : public QObject class Q_EXPORT QEventLoop : public QObject

@ -101,20 +101,20 @@ body { background: #ffffff; color: black; }
<pre> <pre>
win32 { win32 {
thread { thread {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} }
} }
</pre> </pre>
<p>To save writing many nested scopes, you can nest scopes using a colon like this:</p> <p>To save writing many nested scopes, you can nest scopes using a colon like this:</p>
<pre> <pre>
win32:thread { win32:thread {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} }
</pre> </pre>
<p>Once a test has been performed you may also do else/elseif operations. With this you may easily write complicated tests. This can be done with the special 'else' scope, it can be combined with other scopes (separated by colons as above) for example:</p> <p>Once a test has been performed you may also do else/elseif operations. With this you may easily write complicated tests. This can be done with the special 'else' scope, it can be combined with other scopes (separated by colons as above) for example:</p>
<pre> <pre>
win32:thread { win32:thread {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} else:debug { } else:debug {
DEFINES += QT_NOTHREAD_DEBUG DEFINES += QT_NOTHREAD_DEBUG
} else { } else {
@ -166,10 +166,10 @@ body { background: #ffffff; color: black; }
<p>If <em>value</em> is in the list of values stored in the variable called <em>variablename</em>, then the settings inside the scope will be processed. For example:</p> <p>If <em>value</em> is in the list of values stored in the variable called <em>variablename</em>, then the settings inside the scope will be processed. For example:</p>
<pre> <pre>
contains( CONFIG, thread ) { contains( CONFIG, thread ) {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} }
</pre> </pre>
<p>If <em>thread</em> is in the list of values for the <em>CONFIG</em> variable, then TQT_THREAD_SUPPORT will be added to the list of values in the <em>DEFINES</em> variable.</p> <p>If <em>thread</em> is in the list of values for the <em>CONFIG</em> variable, then QT_THREAD_SUPPORT will be added to the list of values in the <em>DEFINES</em> variable.</p>
<h4><a name="5-2"></a>count( variablename, number )</h4> <h4><a name="5-2"></a>count( variablename, number )</h4>
<p>If <em>number</em> matches the number of values stored in the variable called <em>variablename</em>, then the settings inside the scope will be processed. For example:</p> <p>If <em>number</em> matches the number of values stored in the variable called <em>variablename</em>, then the settings inside the scope will be processed. For example:</p>
<pre> <pre>

@ -81,7 +81,7 @@ body { background: #ffffff; color: black; }
#include "qglobal.h" #include "qglobal.h"
#endif // QT_H #endif // QT_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
class QMutexPrivate; class QMutexPrivate;

@ -81,7 +81,7 @@ body { background: #ffffff; color: black; }
#include "qglobal.h" #include "qglobal.h"
#endif // QT_H #endif // QT_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
class QSemaphorePrivate; class QSemaphorePrivate;

@ -77,7 +77,7 @@ body { background: #ffffff; color: black; }
#ifndef QTHREAD_H #ifndef QTHREAD_H
#define QTHREAD_H #define QTHREAD_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#ifndef QT_H #ifndef QT_H
#include "qwindowdefs.h" #include "qwindowdefs.h"
@ -161,7 +161,7 @@ private:
#endif // Q_DISABLE_COPY #endif // Q_DISABLE_COPY
}; };
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#endif // QTHREAD_H #endif // QTHREAD_H
</pre> </pre>

@ -75,7 +75,7 @@ body { background: #ffffff; color: black; }
#ifndef QTHREADSTORAGE_H #ifndef QTHREADSTORAGE_H
#define QTHREADSTORAGE_H #define QTHREADSTORAGE_H
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#ifndef QT_H #ifndef QT_H
#include "qglobal.h" #include "qglobal.h"
@ -126,7 +126,7 @@ public:
{ (void) d.set( t ); } { (void) d.set( t ); }
}; };
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#endif // QTHREADSTORAGE_H #endif // QTHREADSTORAGE_H
</pre> </pre>

@ -81,7 +81,7 @@ body { background: #ffffff; color: black; }
#include "qglobal.h" #include "qglobal.h"
#endif // QT_H #endif // QT_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include &lt;limits.h&gt; #include &lt;limits.h&gt;

@ -81,8 +81,8 @@ such as with a special libc, installation will create a separate
library, <tt>libqt-mt</tt> and hence threaded programs must be linked library, <tt>libqt-mt</tt> and hence threaded programs must be linked
against this library (with <tt>-lqt-mt</tt>) rather than the standard Qt against this library (with <tt>-lqt-mt</tt>) rather than the standard Qt
library. library.
<p> On both platforms, you should compile with the macro <tt>TQT_THREAD_SUPPORT</tt> defined (e.g. compile with <p> On both platforms, you should compile with the macro <tt>QT_THREAD_SUPPORT</tt> defined (e.g. compile with
<tt>-DTQT_THREAD_SUPPORT</tt>). On Windows, this is usually done by an <tt>-DQT_THREAD_SUPPORT</tt>). On Windows, this is usually done by an
entry in <tt>qconfig.h</tt>. entry in <tt>qconfig.h</tt>.
<p> <h2> The Thread Classes <p> <h2> The Thread Classes
</h2> </h2>

@ -69,8 +69,8 @@ against this library (with \c{-lqt-mt}) rather than the standard Qt
library. library.
On both platforms, you should compile with the macro \c On both platforms, you should compile with the macro \c
TQT_THREAD_SUPPORT defined (e.g. compile with QT_THREAD_SUPPORT defined (e.g. compile with
\c{-DTQT_THREAD_SUPPORT}). On Windows, this is usually done by an \c{-DQT_THREAD_SUPPORT}). On Windows, this is usually done by an
entry in \c{qconfig.h}. entry in \c{qconfig.h}.
\section1 The Thread Classes \section1 The Thread Classes

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// uncomment if you have problems with <sys/proc.h> because your gcc // uncomment if you have problems with <sys/proc.h> because your gcc
// hasn't been built on exactly the same OS version your are using now. // hasn't been built on exactly the same OS version your are using now.
// typedef int crid_t; // typedef int crid_t;

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// uncomment if you have problems with <sys/proc.h> because your gcc // uncomment if you have problems with <sys/proc.h> because your gcc
// hasn't been built on exactly the same OS version your are using now. // hasn't been built on exactly the same OS version your are using now.
// typedef int crid_t; // typedef int crid_t;

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -18,7 +18,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -30,7 +30,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -29,7 +29,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -18,7 +18,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -14,7 +14,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -16,7 +16,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -16,7 +16,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -13,7 +13,7 @@
// We are hot - unistd.h should have turned on the specific APIs we requested // We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <pthread.h> #include <pthread.h>
#endif #endif

@ -141,7 +141,7 @@ this:
\code \code
win32 { win32 {
thread { thread {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} }
} }
\endcode \endcode
@ -151,7 +151,7 @@ like this:
\code \code
win32:thread { win32:thread {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} }
\endcode \endcode
@ -162,7 +162,7 @@ colons as above) for example:
\code \code
win32:thread { win32:thread {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} else:debug { } else:debug {
DEFINES += QT_NOTHREAD_DEBUG DEFINES += QT_NOTHREAD_DEBUG
} else { } else {
@ -276,12 +276,12 @@ For example:
\code \code
contains( CONFIG, thread ) { contains( CONFIG, thread ) {
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} }
\endcode \endcode
If \e thread is in the list of values for the \e CONFIG variable, then If \e thread is in the list of values for the \e CONFIG variable, then
TQT_THREAD_SUPPORT will be added to the list of values in the \e QT_THREAD_SUPPORT will be added to the list of values in the \e
DEFINES variable. DEFINES variable.
\section2 count( variablename, number ) \section2 count( variablename, number )

@ -229,7 +229,7 @@ UnixMakefileGenerator::init()
project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_DYNLOAD"]; project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_DYNLOAD"];
if ( project->isActiveConfig("thread") ) { if ( project->isActiveConfig("thread") ) {
if(project->isActiveConfig("qt")) if(project->isActiveConfig("qt"))
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("TQT_THREAD_SUPPORT"); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_THREAD_SUPPORT");
if ( !project->isEmpty("QMAKE_CFLAGS_THREAD")) { if ( !project->isEmpty("QMAKE_CFLAGS_THREAD")) {
project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_THREAD"]; project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_THREAD"];
project->variables()["PRL_EXPORT_CFLAGS"] += project->variables()["QMAKE_CFLAGS_THREAD"]; project->variables()["PRL_EXPORT_CFLAGS"] += project->variables()["QMAKE_CFLAGS_THREAD"];

@ -427,7 +427,7 @@ BorlandMakefileGenerator::init()
} }
if(project->isActiveConfig("qt")) { if(project->isActiveConfig("qt")) {
if ( project->isActiveConfig("thread") ) if ( project->isActiveConfig("thread") )
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("TQT_THREAD_SUPPORT"); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_THREAD_SUPPORT");
if ( project->isActiveConfig("accessibility" ) ) if ( project->isActiveConfig("accessibility" ) )
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_ACCESSIBILITY_SUPPORT"); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_ACCESSIBILITY_SUPPORT");
if ( project->isActiveConfig("tablet") ) if ( project->isActiveConfig("tablet") )

@ -428,7 +428,7 @@ MingwMakefileGenerator::init()
project->variables()["CONFIG"].append("dll"); project->variables()["CONFIG"].append("dll");
} }
if ( project->isActiveConfig("thread") ) { if ( project->isActiveConfig("thread") ) {
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("TQT_THREAD_SUPPORT"); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_THREAD_SUPPORT");
project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_THREAD"]; project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_THREAD"];
project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_THREAD"]; project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_THREAD"];
project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_THREAD"]; project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_THREAD"];

@ -747,7 +747,7 @@ DspMakefileGenerator::init()
} }
if ( thread ) { if ( thread ) {
if(project->isActiveConfig("qt")) if(project->isActiveConfig("qt"))
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("TQT_THREAD_SUPPORT" ); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_THREAD_SUPPORT" );
if ( project->isActiveConfig("dll") || project->first("TARGET") == "qtmain" if ( project->isActiveConfig("dll") || project->first("TARGET") == "qtmain"
|| !project->variables()["QMAKE_QT_DLL"].isEmpty() ) { || !project->variables()["QMAKE_QT_DLL"].isEmpty() ) {
project->variables()["MSVCDSP_MTDEFD"] += project->variables()["QMAKE_CXXFLAGS_MT_DLLDBG"]; project->variables()["MSVCDSP_MTDEFD"] += project->variables()["QMAKE_CXXFLAGS_MT_DLLDBG"];

@ -512,7 +512,7 @@ NmakeMakefileGenerator::init()
project->variables()["CONFIG"].append("dll"); project->variables()["CONFIG"].append("dll");
} }
if ( project->isActiveConfig("thread") ) if ( project->isActiveConfig("thread") )
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("TQT_THREAD_SUPPORT"); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_THREAD_SUPPORT");
if ( project->isActiveConfig("accessibility" ) ) if ( project->isActiveConfig("accessibility" ) )
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_ACCESSIBILITY_SUPPORT"); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_ACCESSIBILITY_SUPPORT");
if ( project->isActiveConfig("tablet") ) if ( project->isActiveConfig("tablet") )

@ -483,7 +483,7 @@ void VcprojGenerator::init()
} }
if( project->isActiveConfig("thread") ) { if( project->isActiveConfig("thread") ) {
project->variables()["DEFINES"] += "TQT_THREAD_SUPPORT"; project->variables()["DEFINES"] += "QT_THREAD_SUPPORT";
project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT_THREAD"]; project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT_THREAD"];
} else { } else {
project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT"]; project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT"];
@ -1209,7 +1209,7 @@ void VcprojGenerator::initOld()
// THREAD -------------------------------------------------------- // THREAD --------------------------------------------------------
if ( project->isActiveConfig("thread") ) { if ( project->isActiveConfig("thread") ) {
if(project->isActiveConfig("qt")) if(project->isActiveConfig("qt"))
project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("TQT_THREAD_SUPPORT" ); project->variables()[is_qt ? "PRL_EXPORT_DEFINES" : "DEFINES"].append("QT_THREAD_SUPPORT" );
if ( !project->variables()["DEFINES"].contains("QT_DLL") && is_qt if ( !project->variables()["DEFINES"].contains("QT_DLL") && is_qt
&& project->first("TARGET") != "qtmain" ) && project->first("TARGET") != "qtmain" )
project->variables()["QMAKE_LFLAGS"].append("/NODEFAULTLIB:libc"); project->variables()["QMAKE_LFLAGS"].append("/NODEFAULTLIB:libc");

@ -75,9 +75,9 @@
# include "qfontcodecs_p.h" # include "qfontcodecs_p.h"
#endif #endif
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h> # include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
@ -121,12 +121,12 @@ void QTextCodec::deleteAllCodecs()
if ( !all ) if ( !all )
return; return;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &all ) : 0 ); qt_global_mutexpool->get( &all ) : 0 );
if ( !all ) if ( !all )
return; return;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
destroying_is_ok = TRUE; destroying_is_ok = TRUE;
@ -151,11 +151,11 @@ static inline void setup()
{ {
if ( all ) return; if ( all ) return;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &all ) : 0 ); qt_global_mutexpool->get( &all ) : 0 );
if ( all ) return; if ( all ) return;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
realSetup(); realSetup();
} }

@ -48,9 +48,9 @@
#include <private/qpluginmanager_p.h> #include <private/qpluginmanager_p.h>
#include "qtextcodecinterface_p.h" #include "qtextcodecinterface_p.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h> # include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <stdlib.h> #include <stdlib.h>
@ -63,7 +63,7 @@ static void create_manager()
if ( manager ) // already created if ( manager ) // already created
return; return;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// protect manager creation // protect manager creation
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &manager ) : 0); qt_global_mutexpool->get( &manager ) : 0);

@ -100,9 +100,9 @@
#endif #endif
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h> # include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#endif // Q_WS_WIN #endif // Q_WS_WIN
#if !defined(Q_OS_TEMP) #if !defined(Q_OS_TEMP)
@ -527,7 +527,7 @@ static void resolveLibs()
static bool triedResolve = FALSE; static bool triedResolve = FALSE;
if ( !triedResolve ) { if ( !triedResolve ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// protect initialization // protect initialization
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &triedResolve ) : 0 ); qt_global_mutexpool->get( &triedResolve ) : 0 );
@ -3203,7 +3203,7 @@ void QFileDialog::setDir( const QString & pathstr )
i++; i++;
QCString user; QCString user;
if ( i == 1 ) { if ( i == 1 ) {
#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) #if defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
# ifndef _POSIX_LOGIN_NAME_MAX # ifndef _POSIX_LOGIN_NAME_MAX
# define _POSIX_LOGIN_NAME_MAX 9 # define _POSIX_LOGIN_NAME_MAX 9
@ -3222,7 +3222,7 @@ void QFileDialog::setDir( const QString & pathstr )
user = dr.mid( 1, i-1 ).local8Bit(); user = dr.mid( 1, i-1 ).local8Bit();
dr = dr.mid( i, dr.length() ); dr = dr.mid( i, dr.length() );
struct passwd *pw; struct passwd *pw;
#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_OPENBSD) #if defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_OPENBSD)
struct passwd mt_pw; struct passwd mt_pw;
char buffer[2048]; char buffer[2048];
if ( ::getpwnam_r( user, &mt_pw, buffer, 2048, &pw ) == 0 && pw == &mt_pw ) if ( ::getpwnam_r( user, &mt_pw, buffer, 2048, &pw ) == 0 && pw == &mt_pw )

@ -43,9 +43,9 @@
#include "qapplication.h" #include "qapplication.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <private/qmutexpool_p.h> #include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <stdlib.h> #include <stdlib.h>
@ -62,7 +62,7 @@ static void create_manager()
if( manager ) // already created if( manager ) // already created
return; return;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// protect manager creation // protect manager creation
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &manager ) : 0); qt_global_mutexpool->get( &manager ) : 0);

@ -65,11 +65,11 @@
#endif #endif
#include "qfontdata_p.h" #include "qfontdata_p.h"
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
# include "qmutex.h" # include "qmutex.h"
# include "qthread.h" # include "qthread.h"
# include <private/qthreadinstance_p.h> # include <private/qthreadinstance_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <stdlib.h> #include <stdlib.h>
@ -375,7 +375,7 @@ QStringList *QApplication::app_libpaths = 0;
bool QApplication::metaComposeUnicode = FALSE; bool QApplication::metaComposeUnicode = FALSE;
int QApplication::composedUnicode = 0; int QApplication::composedUnicode = 0;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutex *QApplication::qt_mutex = 0; QMutex *QApplication::qt_mutex = 0;
QMutex *qt_sharedStringMutex = 0; QMutex *qt_sharedStringMutex = 0;
Q_EXPORT QMutex * qt_sharedMetaObjectMutex = 0; Q_EXPORT QMutex * qt_sharedMetaObjectMutex = 0;
@ -388,13 +388,13 @@ Q_EXPORT Qt::HANDLE qt_get_application_thread_id()
{ {
return qt_application_thread_id; return qt_application_thread_id;
} }
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#ifndef TQT_THREAD_SUPPORT #ifndef QT_THREAD_SUPPORT
QEventLoop *QApplication::eventloop = 0; // application event loop QEventLoop *QApplication::eventloop = 0; // application event loop
#endif #endif
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QEventLoop* QApplication::currentEventLoop() { QEventLoop* QApplication::currentEventLoop() {
QThread* thread = QThread::currentThreadObject(); QThread* thread = QThread::currentThreadObject();
if (thread) { if (thread) {
@ -541,7 +541,7 @@ QClipboard *qt_clipboard = 0; // global clipboard object
#endif #endif
QWidgetList * qt_modal_stack=0; // stack of modal widgets QWidgetList * qt_modal_stack=0; // stack of modal widgets
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// thread wrapper for the main() thread // thread wrapper for the main() thread
class QCoreApplicationThread : public QThread class QCoreApplicationThread : public QThread
{ {
@ -605,9 +605,9 @@ static QPostEventList *globalPostedEvents = 0; // list of posted events
uint qGlobalPostedEventsCount() uint qGlobalPostedEventsCount()
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( postevent_mutex ); QMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if (!globalPostedEvents) { if (!globalPostedEvents) {
return 0; return 0;
@ -1035,7 +1035,7 @@ QApplication::QApplication(Display *dpy, int argc, char **argv,
#endif // Q_WS_X11 #endif // Q_WS_X11
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QThread* QApplication::guiThread() { QThread* QApplication::guiThread() {
return mainThread(); return mainThread();
} }
@ -1069,7 +1069,7 @@ void QApplication::init_precmdline()
void QApplication::initialize( int argc, char **argv, bool enable_sm ) void QApplication::initialize( int argc, char **argv, bool enable_sm )
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
qt_mutex = new QMutex( TRUE ); qt_mutex = new QMutex( TRUE );
qt_sharedStringMutex = new QMutex( TRUE ); qt_sharedStringMutex = new QMutex( TRUE );
qt_sharedMetaObjectMutex = new QMutex( TRUE ); qt_sharedMetaObjectMutex = new QMutex( TRUE );
@ -1078,7 +1078,7 @@ void QApplication::initialize( int argc, char **argv, bool enable_sm )
#endif // QT_USE_GLIBMAINLOOP #endif // QT_USE_GLIBMAINLOOP
postevent_mutex = new QMutex( TRUE ); postevent_mutex = new QMutex( TRUE );
qt_application_thread_id = QThread::currentThread(); qt_application_thread_id = QThread::currentThread();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
app_argc = argc; app_argc = argc;
app_argv = argv; app_argv = argv;
@ -1226,12 +1226,12 @@ QApplication::~QApplication()
app_libpaths = 0; app_libpaths = 0;
#endif #endif
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
delete qt_mutex; delete qt_mutex;
qt_mutex = 0; qt_mutex = 0;
delete postevent_mutex; delete postevent_mutex;
postevent_mutex = 0; postevent_mutex = 0;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if( qApp == this ) { if( qApp == this ) {
if ( postedEvents ) if ( postedEvents )
@ -1254,7 +1254,7 @@ QApplication::~QApplication()
session_key = 0; session_key = 0;
#endif //QT_NO_SESSIONMANAGER #endif //QT_NO_SESSIONMANAGER
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
delete qt_sharedMetaObjectMutex; delete qt_sharedMetaObjectMutex;
qt_sharedMetaObjectMutex = 0; qt_sharedMetaObjectMutex = 0;
delete qt_sharedStringMutex; delete qt_sharedStringMutex;
@ -1263,7 +1263,7 @@ QApplication::~QApplication()
delete qt_timerListMutex; delete qt_timerListMutex;
qt_timerListMutex = 0; qt_timerListMutex = 0;
#endif // QT_USE_GLIBMAINLOOP #endif // QT_USE_GLIBMAINLOOP
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
qt_explicit_app_style = FALSE; qt_explicit_app_style = FALSE;
qt_app_has_font = FALSE; qt_app_has_font = FALSE;
@ -2521,9 +2521,9 @@ bool QApplication::notify( QObject *receiver, QEvent *e )
} }
if ( e->type() == QEvent::ChildRemoved && receiver->postedEvents) { if ( e->type() == QEvent::ChildRemoved && receiver->postedEvents) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( postevent_mutex ); QMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if (globalPostedEvents) { if (globalPostedEvents) {
// the QObject destructor calls QObject::removeChild, which calls // the QObject destructor calls QObject::removeChild, which calls
@ -2868,7 +2868,7 @@ bool QApplication::internalNotify( QObject *receiver, QEvent * e)
} }
if (!handled) { if (!handled) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
int locklevel = 0; int locklevel = 0;
int llcount; int llcount;
if (QApplication::qt_mutex) { if (QApplication::qt_mutex) {
@ -2881,7 +2881,7 @@ bool QApplication::internalNotify( QObject *receiver, QEvent * e)
} }
#endif #endif
consumed = receiver->event( e ); consumed = receiver->event( e );
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (QApplication::qt_mutex) { if (QApplication::qt_mutex) {
for (llcount=0; llcount<locklevel; llcount++) { for (llcount=0; llcount<locklevel; llcount++) {
QApplication::qt_mutex->lock(); QApplication::qt_mutex->lock();
@ -3365,9 +3365,9 @@ void QApplication::postEvent( QObject *receiver, QEvent *event )
return; return;
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( postevent_mutex ); QMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( !globalPostedEvents ) { // create list if ( !globalPostedEvents ) { // create list
globalPostedEvents = new QPostEventList; globalPostedEvents = new QPostEventList;
@ -3461,7 +3461,7 @@ void QApplication::postEvent( QObject *receiver, QEvent *event )
l->append( pe ); l->append( pe );
globalPostedEvents->append( pe ); globalPostedEvents->append( pe );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// Wake up the receiver thread event loop // Wake up the receiver thread event loop
QThread* thread = receiver->contextThreadObject(); QThread* thread = receiver->contextThreadObject();
if (thread) { if (thread) {
@ -3514,7 +3514,7 @@ void QApplication::sendPostedEvents( QObject *receiver, int event_type )
sendPostedEvents( 0, QEvent::ChildInserted ); sendPostedEvents( 0, QEvent::ChildInserted );
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( postevent_mutex ); QMutexLocker locker( postevent_mutex );
#endif #endif
@ -3571,9 +3571,9 @@ void QApplication::sendPostedEvents( QObject *receiver, int event_type )
} }
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if ( locker.mutex() ) locker.mutex()->unlock(); if ( locker.mutex() ) locker.mutex()->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
// after all that work, it's time to deliver the event. // after all that work, it's time to deliver the event.
if ( e->type() == QEvent::Paint && r->isWidgetType() ) { if ( e->type() == QEvent::Paint && r->isWidgetType() ) {
QWidget * w = (QWidget*)r; QWidget * w = (QWidget*)r;
@ -3585,9 +3585,9 @@ void QApplication::sendPostedEvents( QObject *receiver, int event_type )
sent = TRUE; sent = TRUE;
QApplication::sendEvent( r, e ); QApplication::sendEvent( r, e );
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if ( locker.mutex() ) locker.mutex()->lock(); if ( locker.mutex() ) locker.mutex()->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
delete e; delete e;
// careful when adding anything below this point - the // careful when adding anything below this point - the
@ -3646,9 +3646,9 @@ void QApplication::removePostedEvents( QObject *receiver, int event_type )
return; return;
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( postevent_mutex ); QMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
// the QObject destructor calls this function directly. this can // the QObject destructor calls this function directly. this can
// happen while the event loop is in the middle of posting events, // happen while the event loop is in the middle of posting events,
@ -3699,9 +3699,9 @@ void QApplication::removePostedEvent( QEvent * event )
return; return;
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( postevent_mutex ); QMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( !globalPostedEvents ) { if ( !globalPostedEvents ) {
#if defined(QT_DEBUG) #if defined(QT_DEBUG)
@ -3797,7 +3797,7 @@ void QApplication::removePostedEvent( QEvent * event )
} }
void qThreadTerminationHandlerRecursive( QObject* object, QThread* originThread, QThread* destinationThread ) { void qThreadTerminationHandlerRecursive( QObject* object, QThread* originThread, QThread* destinationThread ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QThread* objectThread = object->contextThreadObject(); QThread* objectThread = object->contextThreadObject();
if (objectThread && (objectThread == originThread)) { if (objectThread && (objectThread == originThread)) {
QThread::CleanupType cleanupType = objectThread->cleanupType(); QThread::CleanupType cleanupType = objectThread->cleanupType();
@ -3822,7 +3822,7 @@ void qThreadTerminationHandlerRecursive( QObject* object, QThread* originThread,
for ( childObject = children.first(); childObject; childObject = children.next() ) { for ( childObject = children.first(); childObject; childObject = children.next() ) {
qThreadTerminationHandlerRecursive(childObject, originThread, destinationThread); qThreadTerminationHandlerRecursive(childObject, originThread, destinationThread);
} }
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
/*!\internal /*!\internal
@ -3831,14 +3831,14 @@ void qThreadTerminationHandlerRecursive( QObject* object, QThread* originThread,
for thread destruction. for thread destruction.
*/ */
void QApplication::threadTerminationHandler( QThread *originThread ) { void QApplication::threadTerminationHandler( QThread *originThread ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_mutex ); QMutexLocker locker( qt_mutex );
QThread* destinationThread = guiThread(); QThread* destinationThread = guiThread();
const QObjectList* objects = QObject::objectTrees(); const QObjectList* objects = QObject::objectTrees();
for ( QObjectListIt objectit( *objects ) ; *objectit; ++objectit ) { for ( QObjectListIt objectit( *objects ) ; *objectit; ++objectit ) {
qThreadTerminationHandlerRecursive((*objectit), originThread, destinationThread); qThreadTerminationHandlerRecursive((*objectit), originThread, destinationThread);
} }
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
/*!\internal /*!\internal
@ -4190,7 +4190,7 @@ bool QApplication::desktopSettingsAware()
\sa lock(), unlock() \link threads.html Thread Support in Qt\endlink \sa lock(), unlock() \link threads.html Thread Support in Qt\endlink
*/ */
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
void QApplication::lock() void QApplication::lock()
{ {
qt_mutex->lock(); qt_mutex->lock();

@ -61,10 +61,10 @@ class QIMEvent;
class QWSDecoration; class QWSDecoration;
#endif #endif
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
class QMutex; class QMutex;
class QThread; class QThread;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
class QApplication; class QApplication;
@ -297,7 +297,7 @@ public:
static bool x11_apply_settings(); static bool x11_apply_settings();
#endif #endif
void wakeUpGuiThread(); void wakeUpGuiThread();
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
void lock(); void lock();
void unlock(bool wakeUpGui = TRUE); void unlock(bool wakeUpGui = TRUE);
bool locked(); bool locked();
@ -354,9 +354,9 @@ private slots:
#endif #endif
public: public:
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
static QMutex *qt_mutex; static QMutex *qt_mutex;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
private: private:
int app_argc; int app_argc;
@ -372,7 +372,7 @@ private:
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
static QCursor *app_cursor; static QCursor *app_cursor;
#endif #endif
#ifndef TQT_THREAD_SUPPORT #ifndef QT_THREAD_SUPPORT
static QEventLoop* eventloop; static QEventLoop* eventloop;
#endif #endif
static int app_tracking; static int app_tracking;
@ -436,9 +436,9 @@ private:
friend class QDialog; friend class QDialog;
friend class QAccelManager; friend class QAccelManager;
friend class QEvent; friend class QEvent;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
friend class QThread; friend class QThread;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
friend class QTranslator; friend class QTranslator;
friend class QEventLoop; friend class QEventLoop;
friend Q_EXPORT void qt_ucm_initialize( QApplication * ); friend Q_EXPORT void qt_ucm_initialize( QApplication * );
@ -458,7 +458,7 @@ private:
static QEventLoop* currentEventLoop(); static QEventLoop* currentEventLoop();
public: public:
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
static QThread* guiThread(); static QThread* guiThread();
static void threadTerminationHandler( QThread * ); static void threadTerminationHandler( QThread * );
#endif #endif

@ -97,7 +97,7 @@
#endif // QT_NO_IM #endif // QT_NO_IM
#include "qinternal_p.h" // shared double buffer cleanup #include "qinternal_p.h" // shared double buffer cleanup
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
# include "qthread.h" # include "qthread.h"
#endif #endif
@ -1645,7 +1645,7 @@ void qt_init_internal( int *argcptr, char **argv,
setlocale( LC_ALL, "" ); // use correct char set mapping setlocale( LC_ALL, "" ); // use correct char set mapping
setlocale( LC_NUMERIC, "C" ); // make sprintf()/scanf() work setlocale( LC_NUMERIC, "C" ); // make sprintf()/scanf() work
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (( qt_is_gui_used ) && ( !display )) { if (( qt_is_gui_used ) && ( !display )) {
// If Qt is running standalone with a GUI, initialize X11 threading // If Qt is running standalone with a GUI, initialize X11 threading
XInitThreads(); XInitThreads();
@ -2210,7 +2210,7 @@ void qt_init_internal( int *argcptr, char **argv,
QPainter::initialize(); QPainter::initialize();
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
QThread::initialize(); QThread::initialize();
#endif #endif
@ -2498,7 +2498,7 @@ void qt_cleanup()
QColor::cleanup(); QColor::cleanup();
QSharedDoubleBuffer::cleanup(); QSharedDoubleBuffer::cleanup();
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
QThread::cleanup(); QThread::cleanup();
#endif #endif

@ -41,7 +41,7 @@
#include "qapplication.h" #include "qapplication.h"
#include "qdatetime.h" #include "qdatetime.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include "qthread.h" # include "qthread.h"
# include "private/qthreadinstance_p.h" # include "private/qthreadinstance_p.h"
#endif #endif
@ -116,7 +116,7 @@ QEventLoop::QEventLoop( QObject *parent, const char *name )
init(); init();
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QThread* thread = QThread::currentThreadObject(); QThread* thread = QThread::currentThreadObject();
if (thread) { if (thread) {
if (thread->d) { if (thread->d) {
@ -135,7 +135,7 @@ QEventLoop::~QEventLoop()
{ {
cleanup(); cleanup();
delete d; delete d;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QThread* thread = QThread::currentThreadObject(); QThread* thread = QThread::currentThreadObject();
if (thread) { if (thread) {
if (thread->d) { if (thread->d) {

@ -59,9 +59,9 @@ struct timeval; //stdc struct
struct TimerInfo; //internal structure (qeventloop_mac.cpp) struct TimerInfo; //internal structure (qeventloop_mac.cpp)
#endif #endif
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
class QMutex; class QMutex;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
class Q_EXPORT QEventLoop : public QObject class Q_EXPORT QEventLoop : public QObject

@ -46,7 +46,7 @@
#include "qbitarray.h" #include "qbitarray.h"
#include "qmutex.h" #include "qmutex.h"
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qthread.h" #include "qthread.h"
#endif #endif
@ -55,11 +55,11 @@
#include <glib.h> #include <glib.h>
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#ifdef QT_USE_GLIBMAINLOOP #ifdef QT_USE_GLIBMAINLOOP
extern QMutex *qt_timerListMutex; extern QMutex *qt_timerListMutex;
#endif // QT_USE_GLIBMAINLOOP #endif // QT_USE_GLIBMAINLOOP
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
/***************************************************************************** /*****************************************************************************
Timer handling; UNIX has no application timer support so we'll have to Timer handling; UNIX has no application timer support so we'll have to
@ -186,7 +186,7 @@ static int allocTimerId() // find avail timer identifier
static void insertTimer( const TimerInfo *ti ) // insert timer info into list static void insertTimer( const TimerInfo *ti ) // insert timer info into list
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->lock(); qt_timerListMutex->lock();
#endif #endif
TimerInfo *t = timerList->first(); TimerInfo *t = timerList->first();
@ -209,7 +209,7 @@ static void insertTimer( const TimerInfo *ti ) // insert timer info into list
qDebug( "QObject: %d timers now exist for object %s::%s", dangerCount, ti->obj->className(), ti->obj->name() ); qDebug( "QObject: %d timers now exist for object %s::%s", dangerCount, ti->obj->className(), ti->obj->name() );
} }
#endif #endif
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->unlock(); qt_timerListMutex->unlock();
#endif #endif
} }
@ -235,7 +235,7 @@ static inline void getTime( timeval &t ) // get time of day
static void repairTimer( const timeval &time ) // repair broken timer static void repairTimer( const timeval &time ) // repair broken timer
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->lock(); qt_timerListMutex->lock();
#endif #endif
timeval diff = watchtime - time; timeval diff = watchtime - time;
@ -244,7 +244,7 @@ static void repairTimer( const timeval &time ) // repair broken timer
t->timeout = t->timeout - diff; t->timeout = t->timeout - diff;
t = timerList->next(); t = timerList->next();
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->unlock(); qt_timerListMutex->unlock();
#endif #endif
} }
@ -262,7 +262,7 @@ static void repairTimer( const timeval &time ) // repair broken timer
timeval *qt_wait_timer() timeval *qt_wait_timer()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->lock(); qt_timerListMutex->lock();
#endif #endif
static timeval tm; static timeval tm;
@ -288,19 +288,19 @@ timeval *qt_wait_timer()
if ( qt_wait_timer_max && *qt_wait_timer_max < tm ) { if ( qt_wait_timer_max && *qt_wait_timer_max < tm ) {
tm = *qt_wait_timer_max; tm = *qt_wait_timer_max;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->unlock(); qt_timerListMutex->unlock();
#endif #endif
return &tm; return &tm;
} }
if ( qt_wait_timer_max ) { if ( qt_wait_timer_max ) {
tm = *qt_wait_timer_max; tm = *qt_wait_timer_max;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->unlock(); qt_timerListMutex->unlock();
#endif #endif
return &tm; return &tm;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex->unlock(); qt_timerListMutex->unlock();
#endif #endif
return 0; // no timers return 0; // no timers
@ -316,7 +316,7 @@ static void initTimers() // initialize timers
timerBitVec->clearBit( i ); timerBitVec->clearBit( i );
} }
timerList = new TimerList; timerList = new TimerList;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
qt_timerListMutex = new QMutex(true); qt_timerListMutex = new QMutex(true);
#endif #endif
Q_CHECK_PTR( timerList ); Q_CHECK_PTR( timerList );
@ -336,18 +336,18 @@ void cleanupTimers()
// Main timer functions for starting and killing timers // Main timer functions for starting and killing timers
int qStartTimer( int interval, QObject *obj ) int qStartTimer( int interval, QObject *obj )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->lock(); if (qt_timerListMutex) qt_timerListMutex->lock();
#endif #endif
if ( !timerList ) { // initialize timer data if ( !timerList ) { // initialize timer data
initTimers(); initTimers();
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->lock(); if (qt_timerListMutex) qt_timerListMutex->lock();
#endif #endif
} }
int id = allocTimerId(); // get free timer id int id = allocTimerId(); // get free timer id
if ( (id <= 0) || (id > (int)timerBitVec->size()) || (!obj) ) { // cannot create timer if ( (id <= 0) || (id > (int)timerBitVec->size()) || (!obj) ) { // cannot create timer
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return 0; return 0;
@ -363,7 +363,7 @@ int qStartTimer( int interval, QObject *obj )
t->timeout = currentTime + t->interval; t->timeout = currentTime + t->interval;
t->obj = obj; t->obj = obj;
insertTimer( t ); // put timer in list insertTimer( t ); // put timer in list
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return id; return id;
@ -371,12 +371,12 @@ int qStartTimer( int interval, QObject *obj )
bool qKillTimer( int id ) bool qKillTimer( int id )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->lock(); if (qt_timerListMutex) qt_timerListMutex->lock();
#endif #endif
register TimerInfo *t; register TimerInfo *t;
if ( (!timerList) || (id <= 0) || (id > (int)timerBitVec->size()) || (!timerBitVec->testBit( id-1 )) ) { if ( (!timerList) || (id <= 0) || (id > (int)timerBitVec->size()) || (!timerBitVec->testBit( id-1 )) ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return FALSE; // not init'd or invalid timer return FALSE; // not init'd or invalid timer
@ -389,13 +389,13 @@ bool qKillTimer( int id )
bool ret; bool ret;
timerBitVec->clearBit( id-1 ); // set timer inactive timerBitVec->clearBit( id-1 ); // set timer inactive
ret = timerList->remove(); ret = timerList->remove();
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return ret; return ret;
} }
else { // id not found else { // id not found
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return FALSE; return FALSE;
@ -404,12 +404,12 @@ bool qKillTimer( int id )
bool qKillTimer( QObject *obj ) bool qKillTimer( QObject *obj )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->lock(); if (qt_timerListMutex) qt_timerListMutex->lock();
#endif #endif
register TimerInfo *t; register TimerInfo *t;
if ( !timerList ) { // not initialized if ( !timerList ) { // not initialized
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return FALSE; return FALSE;
@ -425,7 +425,7 @@ bool qKillTimer( QObject *obj )
t = timerList->next(); t = timerList->next();
} }
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return TRUE; return TRUE;
@ -632,11 +632,11 @@ int QEventLoop::timeToWait() const
int QEventLoop::activateTimers() int QEventLoop::activateTimers()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->lock(); if (qt_timerListMutex) qt_timerListMutex->lock();
#endif #endif
if ( !timerList || !timerList->count() ) { // no timers if ( !timerList || !timerList->count() ) { // no timers
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return 0; return 0;
@ -682,11 +682,11 @@ int QEventLoop::activateTimers()
if ( t->interval.tv_usec > 0 || t->interval.tv_sec > 0 ) { if ( t->interval.tv_usec > 0 || t->interval.tv_sec > 0 ) {
n_act++; n_act++;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
QTimerEvent e( t->id ); QTimerEvent e( t->id );
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
// Be careful...the current thread may not be the target object's thread! // Be careful...the current thread may not be the target object's thread!
if ((!t->obj) || if ((!t->obj) ||
(QThread::currentThreadObject() && QThread::currentThreadObject()->threadPostedEventsDisabled()) || (QThread::currentThreadObject() && QThread::currentThreadObject()->threadPostedEventsDisabled()) ||
@ -696,17 +696,17 @@ int QEventLoop::activateTimers()
else { else {
QApplication::postEvent( t->obj, new QTimerEvent(e) ); // post event to correct thread QApplication::postEvent( t->obj, new QTimerEvent(e) ); // post event to correct thread
} }
#else // defined(TQT_THREAD_SUPPORT) #else // defined(QT_THREAD_SUPPORT)
QApplication::sendEvent( t->obj, &e ); // send event QApplication::sendEvent( t->obj, &e ); // send event
#endif // defined(TQT_THREAD_SUPPORT) #endif // defined(QT_THREAD_SUPPORT)
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->lock(); if (qt_timerListMutex) qt_timerListMutex->lock();
#endif #endif
if ( timerList->findRef( begin ) == -1 ) { if ( timerList->findRef( begin ) == -1 ) {
begin = 0; begin = 0;
} }
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (qt_timerListMutex) qt_timerListMutex->unlock(); if (qt_timerListMutex) qt_timerListMutex->unlock();
#endif #endif
return n_act; return n_act;
@ -731,7 +731,7 @@ int QEventLoop::activateSocketNotifiers()
printf("activate sn : send event fd=%d\n", sn->gPollFD.fd ); printf("activate sn : send event fd=%d\n", sn->gPollFD.fd );
#endif #endif
sn->pending = FALSE; sn->pending = FALSE;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
// Be careful...the current thread may not be the target object's thread! // Be careful...the current thread may not be the target object's thread!
if ((!sn->obj) || if ((!sn->obj) ||
(QThread::currentThreadObject() && QThread::currentThreadObject()->threadPostedEventsDisabled()) || (QThread::currentThreadObject() && QThread::currentThreadObject()->threadPostedEventsDisabled()) ||
@ -741,9 +741,9 @@ int QEventLoop::activateSocketNotifiers()
else { else {
QApplication::postEvent( sn->obj, new QEvent(event) ); // post event to correct thread QApplication::postEvent( sn->obj, new QEvent(event) ); // post event to correct thread
} }
#else // defined(TQT_THREAD_SUPPORT) #else // defined(QT_THREAD_SUPPORT)
QApplication::sendEvent( sn->obj, &event ); // send event QApplication::sendEvent( sn->obj, &event ); // send event
#endif // defined(TQT_THREAD_SUPPORT) #endif // defined(QT_THREAD_SUPPORT)
n_act++; n_act++;
} }
} }

@ -43,9 +43,9 @@
#include "qcolor_p.h" #include "qcolor_p.h"
#include "qt_x11_p.h" #include "qt_x11_p.h"
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
# include "qmutex.h" # include "qmutex.h"
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <errno.h> #include <errno.h>
@ -138,7 +138,7 @@ bool QEventLoop::processEvents( ProcessEventsFlags flags )
XEvent event; XEvent event;
int nevents = 0; int nevents = 0;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
QMutexLocker locker( QApplication::qt_mutex ); QMutexLocker locker( QApplication::qt_mutex );
#endif #endif
@ -283,7 +283,7 @@ bool QEventLoop::processEvents( ProcessEventsFlags flags )
// unlock the GUI mutex and select. when we return from this function, there is // unlock the GUI mutex and select. when we return from this function, there is
// something for us to do // something for us to do
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if ( locker.mutex() ) locker.mutex()->unlock(); if ( locker.mutex() ) locker.mutex()->unlock();
else return false; else return false;
#endif #endif
@ -298,7 +298,7 @@ bool QEventLoop::processEvents( ProcessEventsFlags flags )
} while (nsel == -1 && (errno == EINTR || errno == EAGAIN)); } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));
// relock the GUI mutex before processing any pending events // relock the GUI mutex before processing any pending events
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if ( locker.mutex() ) locker.mutex()->lock(); if ( locker.mutex() ) locker.mutex()->lock();
else return false; else return false;
#endif #endif

@ -46,10 +46,10 @@
#include "qcolor_p.h" #include "qcolor_p.h"
#include "qt_x11_p.h" #include "qt_x11_p.h"
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
# include "qmutex.h" # include "qmutex.h"
# include "qthread.h" # include "qthread.h"
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <errno.h> #include <errno.h>
@ -295,7 +295,7 @@ bool QEventLoop::processX11Events()
XEvent event; XEvent event;
int nevents = 0; int nevents = 0;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
QMutexLocker locker( QApplication::qt_mutex ); QMutexLocker locker( QApplication::qt_mutex );
#endif #endif
@ -383,7 +383,7 @@ bool QEventLoop::gsourcePrepare(GSource *gs, int * timeout)
ProcessEventsFlags flags = d->pev_flags; ProcessEventsFlags flags = d->pev_flags;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
QMutexLocker locker( QApplication::qt_mutex ); QMutexLocker locker( QApplication::qt_mutex );
#endif #endif
@ -535,10 +535,10 @@ bool QEventLoop::gsourceDispatch(GSource *gs) {
Q_UNUSED(gs); Q_UNUSED(gs);
// relock the GUI mutex before processing any pending events // relock the GUI mutex before processing any pending events
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
QMutexLocker locker( QApplication::qt_mutex ); QMutexLocker locker( QApplication::qt_mutex );
#endif #endif
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (locker.mutex()) locker.mutex()->lock(); if (locker.mutex()) locker.mutex()->lock();
#endif #endif
@ -608,13 +608,13 @@ bool QEventLoop::gsourceDispatch(GSource *gs) {
// color approx. optimization - only on X11 // color approx. optimization - only on X11
qt_reset_color_avail(); qt_reset_color_avail();
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (locker.mutex()) locker.mutex()->unlock(); if (locker.mutex()) locker.mutex()->unlock();
#endif #endif
processX11Events(); processX11Events();
} }
else { else {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (locker.mutex()) locker.mutex()->unlock(); if (locker.mutex()) locker.mutex()->unlock();
#endif #endif
} }
@ -629,9 +629,9 @@ bool QEventLoop::gsourceDispatch(GSource *gs) {
bool QEventLoop::hasPendingEvents() const bool QEventLoop::hasPendingEvents() const
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( QApplication::qt_mutex ); QMutexLocker locker( QApplication::qt_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
extern uint qGlobalPostedEventsCount(); // from qapplication.cpp extern uint qGlobalPostedEventsCount(); // from qapplication.cpp
return ( qGlobalPostedEventsCount() || ( (qt_is_gui_used && QApplication::isGuiThread()) ? XPending( QPaintDevice::x11AppDisplay() ) : 0)); return ( qGlobalPostedEventsCount() || ( (qt_is_gui_used && QApplication::isGuiThread()) ? XPending( QPaintDevice::x11AppDisplay() ) : 0));

@ -269,13 +269,13 @@ void QFont::initialize()
QString sample; QString sample;
if ( ttmp != -1 ) { if ( ttmp != -1 ) {
#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) #if defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant versions of localtime() where available // use the reentrant versions of localtime() where available
tm res; tm res;
tt = localtime_r( &ttmp, &res ); tt = localtime_r( &ttmp, &res );
#else #else
tt = localtime( &ttmp ); tt = localtime( &ttmp );
#endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS #endif // QT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
if ( tt != 0 && strftime( samp, 64, "%A%B", tt ) > 0 ) if ( tt != 0 && strftime( samp, 64, "%A%B", tt ) > 0 )
if ( codec ) if ( codec )

@ -66,7 +66,7 @@
#endif #endif
#ifndef Q_EXPORT_PLUGIN #ifndef Q_EXPORT_PLUGIN
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#define QT_THREADED_BUILD 1 #define QT_THREADED_BUILD 1
#define Q_PLUGIN_FLAGS_STRING "11" #define Q_PLUGIN_FLAGS_STRING "11"
#else #else

@ -41,9 +41,9 @@
#include "qmetaobject.h" #include "qmetaobject.h"
#include "qasciidict.h" #include "qasciidict.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <private/qmutexpool_p.h> #include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
/*! /*!
\class QMetaData qmetaobject.h \class QMetaData qmetaobject.h
@ -282,10 +282,10 @@ QMetaObject::~QMetaObject()
delete slotDict; // delete dicts delete slotDict; // delete dicts
delete signalDict; delete signalDict;
delete d; delete d;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker( qt_global_mutexpool ? QMutexLocker( qt_global_mutexpool ?
qt_global_mutexpool->get( &qt_metaobjects ) : 0 ); qt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( qt_metaobjects ) { if ( qt_metaobjects ) {
qt_metaobjects->remove( classname ); qt_metaobjects->remove( classname );
if ( qt_metaobjects->isEmpty() ) { if ( qt_metaobjects->isEmpty() ) {
@ -799,10 +799,10 @@ QMetaObject *QMetaObject::metaObject( const char *class_name )
{ {
if ( !qt_metaobjects ) if ( !qt_metaobjects )
return 0; return 0;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker( qt_global_mutexpool ? QMutexLocker( qt_global_mutexpool ?
qt_global_mutexpool->get( &qt_metaobjects ) : 0 ); qt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
QtStaticMetaObjectFunction func = (QtStaticMetaObjectFunction)qt_metaobjects->find( class_name ); QtStaticMetaObjectFunction func = (QtStaticMetaObjectFunction)qt_metaobjects->find( class_name );
if ( func ) if ( func )
return func(); return func();
@ -814,10 +814,10 @@ bool QMetaObject::hasMetaObject( const char *class_name )
{ {
if ( !qt_metaobjects ) if ( !qt_metaobjects )
return FALSE; return FALSE;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker( qt_global_mutexpool ? QMutexLocker( qt_global_mutexpool ?
qt_global_mutexpool->get( &qt_metaobjects ) : 0 ); qt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
return !!qt_metaobjects->find( class_name ); return !!qt_metaobjects->find( class_name );
} }
@ -1204,10 +1204,10 @@ bool QMetaProperty::reset( QObject* o ) const
QMetaObjectCleanUp::QMetaObjectCleanUp( const char *mo_name, QtStaticMetaObjectFunction func ) QMetaObjectCleanUp::QMetaObjectCleanUp( const char *mo_name, QtStaticMetaObjectFunction func )
: metaObject( 0 ) : metaObject( 0 )
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker( qt_global_mutexpool ? QMutexLocker( qt_global_mutexpool ?
qt_global_mutexpool->get( &qt_metaobjects ) : 0 ); qt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( !qt_metaobjects ) if ( !qt_metaobjects )
qt_metaobjects = new QAsciiDict<void>( 257 ); qt_metaobjects = new QAsciiDict<void>( 257 );
qt_metaobjects->insert( mo_name, (void*)func ); qt_metaobjects->insert( mo_name, (void*)func );
@ -1226,10 +1226,10 @@ QMetaObjectCleanUp::QMetaObjectCleanUp()
QMetaObjectCleanUp::~QMetaObjectCleanUp() QMetaObjectCleanUp::~QMetaObjectCleanUp()
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker( qt_global_mutexpool ? QMutexLocker( qt_global_mutexpool ?
qt_global_mutexpool->get( &qt_metaobjects ) : 0 ); qt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( !--qt_metaobjects_count ) { if ( !--qt_metaobjects_count ) {
delete qt_metaobjects; delete qt_metaobjects;
qt_metaobjects = 0; qt_metaobjects = 0;

@ -52,7 +52,7 @@
// QStyleControlElementData // QStyleControlElementData
#include "qstyle.h" #include "qstyle.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include "qmutex.h" #include "qmutex.h"
#include <private/qmutexpool_p.h> #include <private/qmutexpool_p.h>
#include "qthread.h" #include "qthread.h"
@ -130,16 +130,16 @@ QStyleControlElementDataPrivate* QObject::controlElementDataPrivateObject() {
return d->controlElementDataPrivate; return d->controlElementDataPrivate;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
void QObject::moveToThread_helper(QThread *targetThread) void QObject::moveToThread_helper(QThread *targetThread)
{ {
QEvent e(QEvent::ThreadChange); QEvent e(QEvent::ThreadChange);
QApplication::sendEvent(this, &e); QApplication::sendEvent(this, &e);
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( d->childObjectListMutex ); QMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if (childObjects) { if (childObjects) {
QObject *child; QObject *child;
@ -155,9 +155,9 @@ void QObject::setThreadObject_helper(QThread *targetThread)
{ {
d->ownThread = targetThread; d->ownThread = targetThread;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( d->childObjectListMutex ); QMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if (childObjects) { if (childObjects) {
QObject *child; QObject *child;
@ -185,9 +185,9 @@ void QObject::setThreadObject_helper(QThread *targetThread)
*/ */
void QObject::moveToThread(QThread *targetThread) void QObject::moveToThread(QThread *targetThread)
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( QApplication::qt_mutex ); QMutexLocker locker( QApplication::qt_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if (parentObj) { if (parentObj) {
#if defined(QT_DEBUG) #if defined(QT_DEBUG)
@ -491,7 +491,7 @@ void *qt_find_obj_child( QObject *parent, const char *type, const char *name )
return 0; return 0;
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
/*! /*!
Returns a pointer to the QThread* associated with Returns a pointer to the QThread* associated with
@ -530,12 +530,12 @@ static void qt_spy_signal( QObject* sender, int signal, QUObject* o )
s.sprintf( "%s_%s", mo->className(), sigData->name ); s.sprintf( "%s_%s", mo->className(), sigData->name );
int slot = qt_preliminary_signal_spy->metaObject()->findSlot( s, TRUE ); int slot = qt_preliminary_signal_spy->metaObject()->findSlot( s, TRUE );
if ( slot >= 0 ) { if ( slot >= 0 ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
// protect access to qt_spy_signal_sender // protect access to qt_spy_signal_sender
void * const address = &qt_spy_signal_sender; void * const address = &qt_spy_signal_sender;
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( address ) : 0 ); qt_global_mutexpool->get( address ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
QObject* old_sender = qt_spy_signal_sender; QObject* old_sender = qt_spy_signal_sender;
qt_spy_signal_sender = sender; qt_spy_signal_sender = sender;
@ -554,7 +554,7 @@ static void qt_spy_signal( QObject* sender, int signal, QUObject* o )
static QObjectList* object_trees = 0; static QObjectList* object_trees = 0;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
static QMutex *obj_trees_mutex = 0; static QMutex *obj_trees_mutex = 0;
#endif #endif
@ -562,7 +562,7 @@ static void cleanup_object_trees()
{ {
delete object_trees; delete object_trees;
object_trees = 0; object_trees = 0;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
delete obj_trees_mutex; delete obj_trees_mutex;
obj_trees_mutex = 0; obj_trees_mutex = 0;
#endif #endif
@ -576,7 +576,7 @@ static void ensure_object_trees()
static void insert_tree( QObject* obj ) static void insert_tree( QObject* obj )
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if ( !obj_trees_mutex ) if ( !obj_trees_mutex )
obj_trees_mutex = new QMutex(); obj_trees_mutex = new QMutex();
QMutexLocker locker( obj_trees_mutex ); QMutexLocker locker( obj_trees_mutex );
@ -589,7 +589,7 @@ static void insert_tree( QObject* obj )
static void remove_tree( QObject* obj ) static void remove_tree( QObject* obj )
{ {
if ( object_trees ) { if ( object_trees ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( obj_trees_mutex ); QMutexLocker locker( obj_trees_mutex );
#endif #endif
object_trees->removeRef( obj ); object_trees->removeRef( obj );
@ -780,10 +780,10 @@ QObject::~QObject()
delete childObjects; delete childObjects;
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
delete d->childObjectListMutex; delete d->childObjectListMutex;
delete d->senderObjectListMutex; delete d->senderObjectListMutex;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
delete d; delete d;
} }
@ -1079,17 +1079,17 @@ bool QObject::event( QEvent *e )
QSenderObjectList* sol; QSenderObjectList* sol;
QObject* oldSender = 0; QObject* oldSender = 0;
sol = senderObjects; sol = senderObjects;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( sol ) { if ( sol ) {
oldSender = sol->currentSender; oldSender = sol->currentSender;
sol->ref(); sol->ref();
sol->currentSender = metaEvent->sender(); sol->currentSender = metaEvent->sender();
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock(); sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
QUObject *o = metaEvent->data(); QUObject *o = metaEvent->data();
if (metaEvent->type() == QMetaCallEvent::MetaCallEmit) { if (metaEvent->type() == QMetaCallEvent::MetaCallEmit) {
qt_emit( metaEvent->id(), o ); qt_emit( metaEvent->id(), o );
@ -1097,9 +1097,9 @@ bool QObject::event( QEvent *e )
if (metaEvent->type() == QMetaCallEvent::MetaCallInvoke) { if (metaEvent->type() == QMetaCallEvent::MetaCallInvoke) {
qt_invoke( metaEvent->id(), o ); qt_invoke( metaEvent->id(), o );
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if (sol ) { if (sol ) {
sol->currentSender = oldSender; sol->currentSender = oldSender;
if ( sol->deref() ) { if ( sol->deref() ) {
@ -1108,9 +1108,9 @@ bool QObject::event( QEvent *e )
sol = NULL; sol = NULL;
} }
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (sol) sol->listMutex->unlock(); if (sol) sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
else { else {
qWarning("QObject: Ignoring metacall event from non-owning thread"); qWarning("QObject: Ignoring metacall event from non-owning thread");
@ -1617,9 +1617,9 @@ QConnectionList *QObject::receivers( int signal ) const
void QObject::insertChild( QObject *obj ) void QObject::insertChild( QObject *obj )
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( d->childObjectListMutex ); QMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( obj->isTree ) { if ( obj->isTree ) {
remove_tree( obj ); remove_tree( obj );
@ -1663,9 +1663,9 @@ void QObject::insertChild( QObject *obj )
void QObject::removeChild( QObject *obj ) void QObject::removeChild( QObject *obj )
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( d->childObjectListMutex ); QMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( childObjects && childObjects->removeRef(obj) ) { if ( childObjects && childObjects->removeRef(obj) ) {
obj->parentObj = 0; obj->parentObj = 0;
@ -1903,12 +1903,12 @@ const QObject *QObject::sender()
{ {
#ifndef QT_NO_PRELIMINARY_SIGNAL_SPY #ifndef QT_NO_PRELIMINARY_SIGNAL_SPY
if ( this == qt_preliminary_signal_spy ) { if ( this == qt_preliminary_signal_spy ) {
# ifdef TQT_THREAD_SUPPORT # ifdef QT_THREAD_SUPPORT
// protect access to qt_spy_signal_sender // protect access to qt_spy_signal_sender
void * const address = &qt_spy_signal_sender; void * const address = &qt_spy_signal_sender;
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( address ) : 0 ); qt_global_mutexpool->get( address ) : 0 );
# endif // TQT_THREAD_SUPPORT # endif // QT_THREAD_SUPPORT
return qt_spy_signal_sender; return qt_spy_signal_sender;
} }
#endif #endif
@ -2252,24 +2252,24 @@ void QObject::connectInternal( const QObject *sender, int signal_index, const QO
Q_CHECK_PTR( c ); Q_CHECK_PTR( c );
clist->append( c ); clist->append( c );
if ( !r->senderObjects ) { // create list of senders if ( !r->senderObjects ) { // create list of senders
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
r->d->senderObjectListMutex->lock(); r->d->senderObjectListMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
r->senderObjects = new QSenderObjectList; r->senderObjects = new QSenderObjectList;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
r->senderObjects->listMutex->lock(); r->senderObjects->listMutex->lock();
r->d->senderObjectListMutex->unlock(); r->d->senderObjectListMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
else { else {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
r->senderObjects->listMutex->lock(); r->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
r->senderObjects->append( s ); // add sender to list r->senderObjects->append( s ); // add sender to list
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
r->senderObjects->listMutex->unlock(); r->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
@ -2475,25 +2475,25 @@ bool QObject::disconnectInternal( const QObject *sender, int signal_index,
c = clist->first(); c = clist->first();
while ( c ) { // for all receivers... while ( c ) { // for all receivers...
if ( r == 0 ) { // remove all receivers if ( r == 0 ) { // remove all receivers
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
removeObjFromList( c->object()->senderObjects, s ); removeObjFromList( c->object()->senderObjects, s );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
success = TRUE; success = TRUE;
c = clist->next(); c = clist->next();
} else if ( r == c->object() && } else if ( r == c->object() &&
( (member_index == -1) || ( (member_index == -1) ||
((member_index == c->member()) && (c->memberType() == membcode)) ) ) { ((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
removeObjFromList( c->object()->senderObjects, s, TRUE ); removeObjFromList( c->object()->senderObjects, s, TRUE );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
success = TRUE; success = TRUE;
clist->remove(); clist->remove();
c = clist->current(); c = clist->current();
@ -2512,25 +2512,25 @@ bool QObject::disconnectInternal( const QObject *sender, int signal_index,
c = clist->first(); c = clist->first();
while ( c ) { // for all receivers... while ( c ) { // for all receivers...
if ( r == 0 ) { // remove all receivers if ( r == 0 ) { // remove all receivers
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
removeObjFromList( c->object()->senderObjects, s, TRUE ); removeObjFromList( c->object()->senderObjects, s, TRUE );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
success = TRUE; success = TRUE;
c = clist->next(); c = clist->next();
} else if ( r == c->object() && } else if ( r == c->object() &&
( (member_index == -1) || ( (member_index == -1) ||
((member_index == c->member()) && (c->memberType() == membcode)) ) ) { ((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
removeObjFromList( c->object()->senderObjects, s, TRUE ); removeObjFromList( c->object()->senderObjects, s, TRUE );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock(); if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
success = TRUE; success = TRUE;
clist->remove(); clist->remove();
c = clist->current(); c = clist->current();
@ -2772,9 +2772,9 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
c = clist->first(); c = clist->first();
object = c->object(); object = c->object();
sol = object->senderObjects; sol = object->senderObjects;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( sol ) { if ( sol ) {
oldSender = sol->currentSender; oldSender = sol->currentSender;
sol->ref(); sol->ref();
@ -2785,13 +2785,13 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
(object->d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) ||
(currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && currentThread->threadPostedEventsDisabled()) ||
(currentThread && object->d->ownThread == currentThread)) { (currentThread && object->d->ownThread == currentThread)) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock(); sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
object->qt_emit( c->member(), o ); object->qt_emit( c->member(), o );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
else { else {
if (object->d->ownThread && !object->d->ownThread->finished()) { if (object->d->ownThread && !object->d->ownThread->finished()) {
@ -2807,13 +2807,13 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
(object->d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) ||
(currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && currentThread->threadPostedEventsDisabled()) ||
(currentThread && object->d->ownThread == currentThread)) { (currentThread && object->d->ownThread == currentThread)) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock(); sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
object->qt_invoke( c->member(), o ); object->qt_invoke( c->member(), o );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
else { else {
if (object->d->ownThread && !object->d->ownThread->finished()) { if (object->d->ownThread && !object->d->ownThread->finished()) {
@ -2832,9 +2832,9 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
sol = NULL; sol = NULL;
} }
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (sol) sol->listMutex->unlock(); if (sol) sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} else { } else {
QConnection *cd = 0; QConnection *cd = 0;
QConnectionListIt it(*clist); QConnectionListIt it(*clist);
@ -2845,9 +2845,9 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
cd = c; cd = c;
object = c->object(); object = c->object();
sol = object->senderObjects; sol = object->senderObjects;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( sol ) { if ( sol ) {
oldSender = sol->currentSender; oldSender = sol->currentSender;
sol->ref(); sol->ref();
@ -2858,13 +2858,13 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
(object->d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) ||
(currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && currentThread->threadPostedEventsDisabled()) ||
(currentThread && object->d->ownThread == currentThread)) { (currentThread && object->d->ownThread == currentThread)) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock(); sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
object->qt_emit( c->member(), o ); object->qt_emit( c->member(), o );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
else { else {
if (object->d->ownThread && !object->d->ownThread->finished()) { if (object->d->ownThread && !object->d->ownThread->finished()) {
@ -2880,13 +2880,13 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
(object->d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) ||
(currentThread && currentThread->threadPostedEventsDisabled()) || (currentThread && currentThread->threadPostedEventsDisabled()) ||
(currentThread && object->d->ownThread == currentThread)) { (currentThread && object->d->ownThread == currentThread)) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock(); sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
object->qt_invoke( c->member(), o ); object->qt_invoke( c->member(), o );
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
sol->listMutex->lock(); sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
else { else {
if (object->d->ownThread && !object->d->ownThread->finished()) { if (object->d->ownThread && !object->d->ownThread->finished()) {
@ -2905,9 +2905,9 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
sol = NULL; sol = NULL;
} }
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
if (sol) sol->listMutex->unlock(); if (sol) sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
} }
} }
} }
@ -3046,9 +3046,9 @@ void QObject::dumpObjectTree()
void QObject::dumpObjectInfo() void QObject::dumpObjectInfo()
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( d->senderObjectListMutex ); QMutexLocker locker( d->senderObjectListMutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#if defined(QT_DEBUG) #if defined(QT_DEBUG)
qDebug( "OBJECT %s::%s", className(), name( "unnamed" ) ); qDebug( "OBJECT %s::%s", className(), name( "unnamed" ) );

@ -64,7 +64,7 @@ class QObjectUserData;
#endif #endif
struct QUObject; struct QUObject;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
class QThread; class QThread;
#endif #endif
@ -230,14 +230,14 @@ private: // Disabled copy constructor and operator=
#endif #endif
public: public:
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QThread* contextThreadObject() const; QThread* contextThreadObject() const;
void moveToThread(QThread *targetThread); void moveToThread(QThread *targetThread);
void disableThreadPostedEvents(bool disable); void disableThreadPostedEvents(bool disable);
#endif #endif
private: private:
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
void moveToThread_helper(QThread *targetThread); void moveToThread_helper(QThread *targetThread);
void setThreadObject_helper(QThread *targetThread); void setThreadObject_helper(QThread *targetThread);
#endif #endif

@ -36,7 +36,7 @@
** **
**********************************************************************/ **********************************************************************/
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include "qplatformdefs.h" #include "qplatformdefs.h"
@ -132,9 +132,9 @@
QThread::QThread() QThread::QThread()
{ {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( QApplication::qt_mutex ); QMutexLocker locker( QApplication::qt_mutex );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
d = new QThreadInstance; d = new QThreadInstance;
d->init(0); d->init(0);
@ -282,4 +282,4 @@ void QEventLoopThread::run()
if (eventLoop) eventLoop->exec(); if (eventLoop) eventLoop->exec();
} }
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT

@ -41,7 +41,7 @@
#ifndef QTHREAD_H #ifndef QTHREAD_H
#define QTHREAD_H #define QTHREAD_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#ifndef QT_H #ifndef QT_H
#include "qwindowdefs.h" #include "qwindowdefs.h"
@ -150,6 +150,6 @@ class Q_EXPORT QEventLoopThread : public QThread
virtual void run(); virtual void run();
}; };
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#endif // QTHREAD_H #endif // QTHREAD_H

@ -36,7 +36,7 @@
** **
**********************************************************************/ **********************************************************************/
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qplatformdefs.h" #include "qplatformdefs.h"
@ -557,4 +557,4 @@ QThread *QThread::currentThreadObject()
} }
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT

@ -56,7 +56,7 @@
#include "qstyle.h" #include "qstyle.h"
#include "qmetaobject.h" #include "qmetaobject.h"
#include "qguardedptr.h" #include "qguardedptr.h"
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qthread.h" #include "qthread.h"
#endif #endif
#if defined(QT_ACCESSIBILITY_SUPPORT) #if defined(QT_ACCESSIBILITY_SUPPORT)
@ -890,7 +890,7 @@ QWidget::QWidget( QWidget *parent, const char *name, WFlags f, NFlags n )
} }
#endif #endif
#if defined(TQT_THREAD_SUPPORT) && defined(QT_CHECK_STATE) #if defined(QT_THREAD_SUPPORT) && defined(QT_CHECK_STATE)
if (QThread::currentThreadObject() != QApplication::guiThread()) { if (QThread::currentThreadObject() != QApplication::guiThread()) {
qFatal( "QWidget: Cannot create a QWidget outside of the main GUI thread" ); qFatal( "QWidget: Cannot create a QWidget outside of the main GUI thread" );
} }

@ -2987,8 +2987,8 @@ void generateClass() // generate C++ source code for a class
// //
fprintf( out, "QMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() ); fprintf( out, "QMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() );
fprintf( out, " if ( metaObj ) {\n\treturn metaObj;\n}\n" ); fprintf( out, " if ( metaObj ) {\n\treturn metaObj;\n}\n" );
fprintf( out, "#ifdef TQT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->lock();\n" ); fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->lock();\n" );
fprintf( out, " if ( metaObj ) {\n\tif (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n\treturn metaObj;\n }\n#endif // TQT_THREAD_SUPPORT\n" ); fprintf( out, " if ( metaObj ) {\n\tif (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n\treturn metaObj;\n }\n#endif // QT_THREAD_SUPPORT\n" );
if ( isQObject ) if ( isQObject )
fprintf( out, " QMetaObject* parentObject = staticQtMetaObject();\n" ); fprintf( out, " QMetaObject* parentObject = staticQtMetaObject();\n" );
else if ( !g->superClassName.isEmpty() ) else if ( !g->superClassName.isEmpty() )
@ -3058,7 +3058,7 @@ void generateClass() // generate C++ source code for a class
// Setup cleanup handler and return meta object // Setup cleanup handler and return meta object
// //
fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() ); fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() );
fprintf( out, "#ifdef TQT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n#endif // TQT_THREAD_SUPPORT\n" ); fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n#endif // QT_THREAD_SUPPORT\n" );
fprintf( out, " return metaObj;\n}\n" ); fprintf( out, " return metaObj;\n}\n" );
// //

@ -5813,8 +5813,8 @@ void generateClass() // generate C++ source code for a class
// //
fprintf( out, "QMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() ); fprintf( out, "QMetaObject* %s::staticMetaObject()\n{\n", (const char*)qualifiedClassName() );
fprintf( out, " if ( metaObj ) {\n\treturn metaObj;\n}\n" ); fprintf( out, " if ( metaObj ) {\n\treturn metaObj;\n}\n" );
fprintf( out, "#ifdef TQT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->lock();\n" ); fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->lock();\n" );
fprintf( out, " if ( metaObj ) {\n\tif (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n\treturn metaObj;\n }\n#endif // TQT_THREAD_SUPPORT\n" ); fprintf( out, " if ( metaObj ) {\n\tif (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n\treturn metaObj;\n }\n#endif // QT_THREAD_SUPPORT\n" );
if ( isQObject ) if ( isQObject )
fprintf( out, " QMetaObject* parentObject = staticQtMetaObject();\n" ); fprintf( out, " QMetaObject* parentObject = staticQtMetaObject();\n" );
else if ( !g->superClassName.isEmpty() ) else if ( !g->superClassName.isEmpty() )
@ -5884,7 +5884,7 @@ void generateClass() // generate C++ source code for a class
// Setup cleanup handler and return meta object // Setup cleanup handler and return meta object
// //
fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() ); fprintf( out, " cleanUp_%s.setMetaObject( metaObj );\n", cleanup.data() );
fprintf( out, "#ifdef TQT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n#endif // TQT_THREAD_SUPPORT\n" ); fprintf( out, "#ifdef QT_THREAD_SUPPORT\n if (qt_sharedMetaObjectMutex) qt_sharedMetaObjectMutex->unlock();\n#endif // QT_THREAD_SUPPORT\n" );
fprintf( out, " return metaObj;\n}\n" ); fprintf( out, " return metaObj;\n}\n" );
// //

@ -121,7 +121,7 @@ thread {
!win32-borland:TARGET = qt-mt !win32-borland:TARGET = qt-mt
win32-borland:TARGET = qtmt win32-borland:TARGET = qtmt
embedded:TARGET = qte-mt embedded:TARGET = qte-mt
DEFINES += TQT_THREAD_SUPPORT DEFINES += QT_THREAD_SUPPORT
} }
!cups:DEFINES += QT_NO_CUPS !cups:DEFINES += QT_NO_CUPS

@ -273,7 +273,7 @@ public: \
ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;} ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;}
#ifndef Q_EXPORT_COMPONENT #ifndef Q_EXPORT_COMPONENT
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#define QT_THREADED_BUILD 1 #define QT_THREADED_BUILD 1
#define Q_UCM_FLAGS_STRING "11" #define Q_UCM_FLAGS_STRING "11"
#else #else

@ -48,9 +48,9 @@
#include <errno.h> #include <errno.h>
#endif // NO_ERROR_H #endif // NO_ERROR_H
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include "qmutexpool_p.h" # include "qmutexpool_p.h"
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#ifndef QT_DEBUG_COMPONENT #ifndef QT_DEBUG_COMPONENT
# if defined(QT_DEBUG) # if defined(QT_DEBUG)
@ -94,7 +94,7 @@ static bool qt_verify( const QString& library, uint version, uint flags,
const QCString &key, bool warn ) const QCString &key, bool warn )
{ {
uint our_flags = 1; uint our_flags = 1;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
our_flags |= 2; our_flags |= 2;
#endif #endif
@ -398,10 +398,10 @@ void QComLibrary::createInstanceInternal()
bool query_done = FALSE; bool query_done = FALSE;
bool warn_mismatch = TRUE; bool warn_mismatch = TRUE;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &cache ) : 0 ); qt_global_mutexpool->get( &cache ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( ! cache ) { if ( ! cache ) {
cache = new QSettings; cache = new QSettings;

@ -36,7 +36,7 @@
** **
**********************************************************************/ **********************************************************************/
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qt_windows.h" #include "qt_windows.h"

@ -54,7 +54,7 @@
// //
// //
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#if defined(Q_WS_WIN) #if defined(Q_WS_WIN)

@ -43,9 +43,9 @@
#include "qregexp.h" #include "qregexp.h"
#include "qdatastream.h" #include "qdatastream.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h> # include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
@ -312,10 +312,10 @@ Q_UINT16 qChecksum( const char *data, uint len )
{ {
if ( !crc_tbl_init ) { // create lookup table if ( !crc_tbl_init ) { // create lookup table
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &crc_tbl_init ) : 0 ); qt_global_mutexpool->get( &crc_tbl_init ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( !crc_tbl_init ) { if ( !crc_tbl_init ) {
createCRC16Table(); createCRC16Table();

@ -1039,7 +1039,7 @@ QDate QDate::currentDate( Qt::TimeSpec ts )
time( &ltime ); time( &ltime );
tm *t; tm *t;
# if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) # if defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant versions of localtime() and gmtime() where available // use the reentrant versions of localtime() and gmtime() where available
tm res; tm res;
if ( ts == Qt::LocalTime ) if ( ts == Qt::LocalTime )
@ -1051,7 +1051,7 @@ QDate QDate::currentDate( Qt::TimeSpec ts )
t = localtime( &ltime ); t = localtime( &ltime );
else else
t = gmtime( &ltime ); t = gmtime( &ltime );
# endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS # endif // QT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
d.jd = gregorianToJulian( t->tm_year + 1900, t->tm_mon + 1, t->tm_mday ); d.jd = gregorianToJulian( t->tm_year + 1900, t->tm_mon + 1, t->tm_mday );
#endif #endif
@ -1729,7 +1729,7 @@ bool QTime::currentTime( QTime *ct, Qt::TimeSpec ts )
time_t ltime = tv.tv_sec; time_t ltime = tv.tv_sec;
tm *t; tm *t;
# if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) # if defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// use the reentrant versions of localtime() and gmtime() where available // use the reentrant versions of localtime() and gmtime() where available
tm res; tm res;
if ( ts == Qt::LocalTime ) if ( ts == Qt::LocalTime )
@ -1741,7 +1741,7 @@ bool QTime::currentTime( QTime *ct, Qt::TimeSpec ts )
t = localtime( &ltime ); t = localtime( &ltime );
else else
t = gmtime( &ltime ); t = gmtime( &ltime );
# endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS # endif // QT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
ct->ds = (uint)( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + ct->ds = (uint)( MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min +
1000 * t->tm_sec + tv.tv_usec / 1000 ); 1000 * t->tm_sec + tv.tv_usec / 1000 );
@ -2042,7 +2042,7 @@ void QDateTime::setTime_t( time_t secsSince1Jan1970UTC, Qt::TimeSpec ts )
time_t tmp = secsSince1Jan1970UTC; time_t tmp = secsSince1Jan1970UTC;
tm *brokenDown = 0; tm *brokenDown = 0;
#if defined(Q_OS_UNIX) && defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) #if defined(Q_OS_UNIX) && defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// posix compliant system // posix compliant system
// use the reentrant versions of localtime() and gmtime() where available // use the reentrant versions of localtime() and gmtime() where available
tm res; tm res;

@ -48,9 +48,9 @@
#include "qregexp.h" #include "qregexp.h"
#include "qstringlist.h" #include "qstringlist.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h> # include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
@ -237,7 +237,7 @@ bool QDir::readDirEntries( const QString &nameFilter,
if ( !dir ) if ( !dir )
return FALSE; // cannot read the directory return FALSE; // cannot read the directory
#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) #if defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
union { union {
struct dirent mt_file; struct dirent mt_file;
char b[sizeof(struct dirent) + MAXNAMLEN + 1]; char b[sizeof(struct dirent) + MAXNAMLEN + 1];
@ -245,7 +245,7 @@ bool QDir::readDirEntries( const QString &nameFilter,
while ( readdir_r(dir, &u.mt_file, &file ) == 0 && file ) while ( readdir_r(dir, &u.mt_file, &file ) == 0 && file )
#else #else
while ( (file = readdir(dir)) ) while ( (file = readdir(dir)) )
#endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS #endif // QT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
{ {
QString fn = QFile::decodeName(file->d_name); QString fn = QFile::decodeName(file->d_name);
fi.setFile( *this, fn ); fi.setFile( *this, fn );
@ -311,10 +311,10 @@ const QFileInfoList * QDir::drives()
if ( !knownMemoryLeak ) { if ( !knownMemoryLeak ) {
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &knownMemoryLeak ) : 0 ); qt_global_mutexpool->get( &knownMemoryLeak ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( !knownMemoryLeak ) { if ( !knownMemoryLeak ) {
knownMemoryLeak = new QFileInfoList; knownMemoryLeak = new QFileInfoList;

@ -52,9 +52,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h> # include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
/* /*
If USE_MALLOC isn't defined, we use new[] and delete[] to allocate If USE_MALLOC isn't defined, we use new[] and delete[] to allocate
@ -733,10 +733,10 @@ void QGArray::sort( uint sz )
if ( numItems < 2 ) if ( numItems < 2 )
return; return;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &cmp_item_size ) : 0 ); qt_global_mutexpool->get( &cmp_item_size ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
cmp_item_size = sz; cmp_item_size = sz;
qsort( shd->data, numItems, sz, cmp_arr ); qsort( shd->data, numItems, sz, cmp_arr );
@ -752,10 +752,10 @@ int QGArray::bsearch( const char *d, uint sz ) const
if ( !numItems ) if ( !numItems )
return -1; return -1;
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &cmp_item_size ) : 0 ); qt_global_mutexpool->get( &cmp_item_size ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
cmp_item_size = sz; cmp_item_size = sz;
char* r = (char*)::bsearch( d, shd->data, numItems, sz, cmp_arr ); char* r = (char*)::bsearch( d, shd->data, numItems, sz, cmp_arr );

@ -43,9 +43,9 @@
#include "qdatastream.h" #include "qdatastream.h"
#include "qvaluelist.h" #include "qvaluelist.h"
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qmutex.h" #include "qmutex.h"
#endif // defined(TQT_THREAD_SUPPORT) #endif // defined(QT_THREAD_SUPPORT)
/*! /*!
\class QLNode qglist.h \class QLNode qglist.h
@ -225,7 +225,7 @@ QDataStream &QGList::write( QDataStream &s, QPtrCollection::Item ) const
QGList::QGList() QGList::QGList()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex = new QMutex(true); //mutex = new QMutex(true);
#endif #endif
firstNode = lastNode = curNode = 0; // initialize list firstNode = lastNode = curNode = 0; // initialize list
@ -241,7 +241,7 @@ QGList::QGList()
QGList::QGList( const QGList & list ) QGList::QGList( const QGList & list )
: QPtrCollection( list ) : QPtrCollection( list )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex = new QMutex(true); //mutex = new QMutex(true);
#endif #endif
firstNode = lastNode = curNode = 0; // initialize list firstNode = lastNode = curNode = 0; // initialize list
@ -268,7 +268,7 @@ QGList::~QGList()
// twice on the same address! This is insane but let's try not to crash // twice on the same address! This is insane but let's try not to crash
// here. // here.
iterators = 0; iterators = 0;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//delete mutex; //delete mutex;
#endif #endif
} }
@ -337,11 +337,11 @@ bool QGList::operator==( const QGList &list ) const
QLNode *QGList::locate( uint index ) QLNode *QGList::locate( uint index )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( index == (uint)curIndex ) { // current node ? if ( index == (uint)curIndex ) { // current node ?
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return curNode; return curNode;
@ -355,7 +355,7 @@ QLNode *QGList::locate( uint index )
bool forward; // direction to traverse bool forward; // direction to traverse
if ( index >= numNodes ) { if ( index >= numNodes ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -388,7 +388,7 @@ QLNode *QGList::locate( uint index )
} }
} }
curIndex = index; // must update index curIndex = index; // must update index
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return curNode = node; return curNode = node;
@ -401,7 +401,7 @@ QLNode *QGList::locate( uint index )
void QGList::inSort( QPtrCollection::Item d ) void QGList::inSort( QPtrCollection::Item d )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
int index = 0; int index = 0;
@ -411,7 +411,7 @@ void QGList::inSort( QPtrCollection::Item d )
index++; index++;
} }
insertAt( index, d ); insertAt( index, d );
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
@ -423,7 +423,7 @@ void QGList::inSort( QPtrCollection::Item d )
void QGList::prepend( QPtrCollection::Item d ) void QGList::prepend( QPtrCollection::Item d )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
register QLNode *n = new QLNode( newItem(d) ); register QLNode *n = new QLNode( newItem(d) );
@ -436,7 +436,7 @@ void QGList::prepend( QPtrCollection::Item d )
firstNode = curNode = n; // curNode affected firstNode = curNode = n; // curNode affected
numNodes++; numNodes++;
curIndex = 0; curIndex = 0;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
@ -448,7 +448,7 @@ void QGList::prepend( QPtrCollection::Item d )
void QGList::append( QPtrCollection::Item d ) void QGList::append( QPtrCollection::Item d )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
register QLNode *n = new QLNode( newItem(d) ); register QLNode *n = new QLNode( newItem(d) );
@ -463,7 +463,7 @@ void QGList::append( QPtrCollection::Item d )
lastNode = curNode = n; // curNode affected lastNode = curNode = n; // curNode affected
curIndex = numNodes; curIndex = numNodes;
numNodes++; numNodes++;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
@ -475,26 +475,26 @@ void QGList::append( QPtrCollection::Item d )
bool QGList::insertAt( uint index, QPtrCollection::Item d ) bool QGList::insertAt( uint index, QPtrCollection::Item d )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( index == 0 ) { if ( index == 0 ) {
prepend( d ); prepend( d );
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
} }
else if ( index == numNodes ) { else if ( index == numNodes ) {
append( d ); append( d );
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
} }
QLNode *nextNode = locate( index ); QLNode *nextNode = locate( index );
if ( !nextNode ) { if ( !nextNode ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
@ -509,7 +509,7 @@ bool QGList::insertAt( uint index, QPtrCollection::Item d )
n->next = nextNode; n->next = nextNode;
curNode = n; // curIndex set by locate() curNode = n; // curIndex set by locate()
numNodes++; numNodes++;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
@ -522,11 +522,11 @@ bool QGList::insertAt( uint index, QPtrCollection::Item d )
void QGList::relinkNode( QLNode *n ) void QGList::relinkNode( QLNode *n )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( n == firstNode ) { // already first if ( n == firstNode ) { // already first
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return; return;
@ -543,7 +543,7 @@ void QGList::relinkNode( QLNode *n )
firstNode = curNode = n; // curNode affected firstNode = curNode = n; // curNode affected
numNodes++; numNodes++;
curIndex = 0; curIndex = 0;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
@ -555,11 +555,11 @@ void QGList::relinkNode( QLNode *n )
QLNode *QGList::unlink() QLNode *QGList::unlink()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( curNode == 0 ) { // null current node if ( curNode == 0 ) { // null current node
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -593,7 +593,7 @@ QLNode *QGList::unlink()
iterators->notifyRemove( n, curNode ); iterators->notifyRemove( n, curNode );
} }
numNodes--; numNodes--;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return n; return n;
@ -606,7 +606,7 @@ QLNode *QGList::unlink()
bool QGList::removeNode( QLNode *n ) bool QGList::removeNode( QLNode *n )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
#if defined(QT_CHECK_NULL) #if defined(QT_CHECK_NULL)
@ -622,7 +622,7 @@ bool QGList::removeNode( QLNode *n )
delete n; delete n;
curNode = firstNode; curNode = firstNode;
curIndex = curNode ? 0 : -1; curIndex = curNode ? 0 : -1;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
@ -636,25 +636,25 @@ bool QGList::removeNode( QLNode *n )
bool QGList::remove( QPtrCollection::Item d ) bool QGList::remove( QPtrCollection::Item d )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( d && find(d) == -1 ) { if ( d && find(d) == -1 ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
} }
QLNode *n = unlink(); QLNode *n = unlink();
if ( !n ) { if ( !n ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
} }
deleteItem( n->data ); deleteItem( n->data );
delete n; delete n;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
@ -666,25 +666,25 @@ bool QGList::remove( QPtrCollection::Item d )
bool QGList::removeRef( QPtrCollection::Item d ) bool QGList::removeRef( QPtrCollection::Item d )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( findRef(d) == -1 ) { if ( findRef(d) == -1 ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
} }
QLNode *n = unlink(); QLNode *n = unlink();
if ( !n ) { if ( !n ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
} }
deleteItem( n->data ); deleteItem( n->data );
delete n; delete n;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
@ -708,25 +708,25 @@ bool QGList::removeRef( QPtrCollection::Item d )
bool QGList::removeAt( uint index ) bool QGList::removeAt( uint index )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( !locate(index) ) { if ( !locate(index) ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
} }
QLNode *n = unlink(); QLNode *n = unlink();
if ( !n ) { if ( !n ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
} }
deleteItem( n->data ); deleteItem( n->data );
delete n; delete n;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
@ -738,12 +738,12 @@ bool QGList::removeAt( uint index )
*/ */
bool QGList::replaceAt( uint index, QPtrCollection::Item d ) bool QGList::replaceAt( uint index, QPtrCollection::Item d )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
QLNode *n = locate( index ); QLNode *n = locate( index );
if ( !n ) { if ( !n ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return FALSE; return FALSE;
@ -752,7 +752,7 @@ bool QGList::replaceAt( uint index, QPtrCollection::Item d )
deleteItem( n->data ); deleteItem( n->data );
n->data = newItem( d ); n->data = newItem( d );
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return TRUE; return TRUE;
@ -766,14 +766,14 @@ bool QGList::replaceAt( uint index, QPtrCollection::Item d )
QPtrCollection::Item QGList::takeNode( QLNode *n ) QPtrCollection::Item QGList::takeNode( QLNode *n )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
#if defined(QT_CHECK_NULL) #if defined(QT_CHECK_NULL)
if ( n == 0 || (n->prev && n->prev->next != n) || if ( n == 0 || (n->prev && n->prev->next != n) ||
(n->next && n->next->prev != n) ) { (n->next && n->next->prev != n) ) {
qWarning( "QGList::takeNode: Corrupted node" ); qWarning( "QGList::takeNode: Corrupted node" );
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -785,7 +785,7 @@ QPtrCollection::Item QGList::takeNode( QLNode *n )
delete n; // delete the node, not data delete n; // delete the node, not data
curNode = firstNode; curNode = firstNode;
curIndex = curNode ? 0 : -1; curIndex = curNode ? 0 : -1;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return d; return d;
@ -797,13 +797,13 @@ QPtrCollection::Item QGList::takeNode( QLNode *n )
QPtrCollection::Item QGList::take() QPtrCollection::Item QGList::take()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
QLNode *n = unlink(); // unlink node QLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0; Item d = n ? n->data : 0;
delete n; // delete node, keep contents delete n; // delete node, keep contents
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return d; return d;
@ -815,11 +815,11 @@ QPtrCollection::Item QGList::take()
QPtrCollection::Item QGList::takeAt( uint index ) QPtrCollection::Item QGList::takeAt( uint index )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( !locate(index) ) { if ( !locate(index) ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -827,7 +827,7 @@ QPtrCollection::Item QGList::takeAt( uint index )
QLNode *n = unlink(); // unlink node QLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0; Item d = n ? n->data : 0;
delete n; // delete node, keep contents delete n; // delete node, keep contents
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return d; return d;
@ -839,14 +839,14 @@ QPtrCollection::Item QGList::takeAt( uint index )
QPtrCollection::Item QGList::takeFirst() QPtrCollection::Item QGList::takeFirst()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
first(); first();
QLNode *n = unlink(); // unlink node QLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0; Item d = n ? n->data : 0;
delete n; delete n;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return d; return d;
@ -858,14 +858,14 @@ QPtrCollection::Item QGList::takeFirst()
QPtrCollection::Item QGList::takeLast() QPtrCollection::Item QGList::takeLast()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
last(); last();
QLNode *n = unlink(); // unlink node QLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0; Item d = n ? n->data : 0;
delete n; delete n;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return d; return d;
@ -878,7 +878,7 @@ QPtrCollection::Item QGList::takeLast()
void QGList::clear() void QGList::clear()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
register QLNode *n = firstNode; register QLNode *n = firstNode;
@ -898,7 +898,7 @@ void QGList::clear()
n = n->next; n = n->next;
delete prevNode; // deallocate node delete prevNode; // deallocate node
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
@ -911,7 +911,7 @@ void QGList::clear()
int QGList::findRef( QPtrCollection::Item d, bool fromStart ) int QGList::findRef( QPtrCollection::Item d, bool fromStart )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
register QLNode *n; register QLNode *n;
@ -929,7 +929,7 @@ int QGList::findRef( QPtrCollection::Item d, bool fromStart )
} }
curNode = n; curNode = n;
curIndex = n ? index : -1; curIndex = n ? index : -1;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return curIndex; // return position of item return curIndex; // return position of item
@ -943,7 +943,7 @@ int QGList::findRef( QPtrCollection::Item d, bool fromStart )
int QGList::find( QPtrCollection::Item d, bool fromStart ) int QGList::find( QPtrCollection::Item d, bool fromStart )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
register QLNode *n; register QLNode *n;
@ -961,7 +961,7 @@ int QGList::find( QPtrCollection::Item d, bool fromStart )
} }
curNode = n; curNode = n;
curIndex = n ? index : -1; curIndex = n ? index : -1;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return curIndex; // return position of item return curIndex; // return position of item
@ -974,7 +974,7 @@ int QGList::find( QPtrCollection::Item d, bool fromStart )
uint QGList::containsRef( QPtrCollection::Item d ) const uint QGList::containsRef( QPtrCollection::Item d ) const
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
register QLNode *n = firstNode; register QLNode *n = firstNode;
@ -984,7 +984,7 @@ uint QGList::containsRef( QPtrCollection::Item d ) const
count++; count++;
n = n->next; n = n->next;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return count; return count;
@ -997,7 +997,7 @@ uint QGList::containsRef( QPtrCollection::Item d ) const
uint QGList::contains( QPtrCollection::Item d ) const uint QGList::contains( QPtrCollection::Item d ) const
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
register QLNode *n = firstNode; register QLNode *n = firstNode;
@ -1008,7 +1008,7 @@ uint QGList::contains( QPtrCollection::Item d ) const
count++; count++;
n = n->next; n = n->next;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return count; return count;
@ -1058,17 +1058,17 @@ uint QGList::contains( QPtrCollection::Item d ) const
QPtrCollection::Item QGList::first() QPtrCollection::Item QGList::first()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( firstNode ) { if ( firstNode ) {
curIndex = 0; curIndex = 0;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return (curNode=firstNode)->data; return (curNode=firstNode)->data;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -1080,17 +1080,17 @@ QPtrCollection::Item QGList::first()
QPtrCollection::Item QGList::last() QPtrCollection::Item QGList::last()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( lastNode ) { if ( lastNode ) {
curIndex = numNodes-1; curIndex = numNodes-1;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return (curNode=lastNode)->data; return (curNode=lastNode)->data;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -1102,14 +1102,14 @@ QPtrCollection::Item QGList::last()
QPtrCollection::Item QGList::next() QPtrCollection::Item QGList::next()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( curNode ) { if ( curNode ) {
if ( curNode->next ) { if ( curNode->next ) {
curIndex++; curIndex++;
curNode = curNode->next; curNode = curNode->next;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return curNode->data; return curNode->data;
@ -1117,7 +1117,7 @@ QPtrCollection::Item QGList::next()
curIndex = -1; curIndex = -1;
curNode = 0; curNode = 0;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -1129,14 +1129,14 @@ QPtrCollection::Item QGList::next()
QPtrCollection::Item QGList::prev() QPtrCollection::Item QGList::prev()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
if ( curNode ) { if ( curNode ) {
if ( curNode->prev ) { if ( curNode->prev ) {
curIndex--; curIndex--;
curNode = curNode->prev; curNode = curNode->prev;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return curNode->data; return curNode->data;
@ -1144,7 +1144,7 @@ QPtrCollection::Item QGList::prev()
curIndex = -1; curIndex = -1;
curNode = 0; curNode = 0;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return 0; return 0;
@ -1157,12 +1157,12 @@ QPtrCollection::Item QGList::prev()
void QGList::toVector( QGVector *vector ) const void QGList::toVector( QGVector *vector ) const
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
vector->clear(); vector->clear();
if ( !vector->resize( count() ) ) { if ( !vector->resize( count() ) ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return; return;
@ -1174,14 +1174,14 @@ void QGList::toVector( QGVector *vector ) const
n = n->next; n = n->next;
i++; i++;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
void QGList::heapSortPushDown( QPtrCollection::Item* heap, int first, int last ) void QGList::heapSortPushDown( QPtrCollection::Item* heap, int first, int last )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
int r = first; int r = first;
@ -1218,7 +1218,7 @@ void QGList::heapSortPushDown( QPtrCollection::Item* heap, int first, int last )
} }
} }
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
@ -1233,12 +1233,12 @@ void QGList::heapSortPushDown( QPtrCollection::Item* heap, int first, int last )
void QGList::sort() void QGList::sort()
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
uint n = count(); uint n = count();
if ( n < 2 ) { if ( n < 2 ) {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return; return;
@ -1273,7 +1273,7 @@ void QGList::sort()
} }
delete [] realheap; delete [] realheap;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
} }
@ -1300,7 +1300,7 @@ QDataStream &operator<<( QDataStream &s, const QGList &list )
QDataStream &QGList::read( QDataStream &s ) QDataStream &QGList::read( QDataStream &s )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
uint num; uint num;
@ -1326,7 +1326,7 @@ QDataStream &QGList::read( QDataStream &s )
} }
curNode = firstNode; curNode = firstNode;
curIndex = curNode ? 0 : -1; curIndex = curNode ? 0 : -1;
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return s; return s;
@ -1338,7 +1338,7 @@ QDataStream &QGList::read( QDataStream &s )
QDataStream &QGList::write( QDataStream &s ) const QDataStream &QGList::write( QDataStream &s ) const
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
s << count(); // write number of items s << count(); // write number of items
@ -1347,7 +1347,7 @@ QDataStream &QGList::write( QDataStream &s ) const
write( s, n->data ); write( s, n->data );
n = n->next; n = n->next;
} }
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return s; return s;
@ -1361,13 +1361,13 @@ QDataStream &QGList::write( QDataStream &s ) const
*/ */
QLNode* QGList::erase( QLNode* it ) QLNode* QGList::erase( QLNode* it )
{ {
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->lock(); //mutex->lock();
#endif #endif
QLNode* n = it; QLNode* n = it;
it = it->next; it = it->next;
removeNode( n ); removeNode( n );
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
//mutex->unlock(); //mutex->unlock();
#endif #endif
return it; return it;

@ -150,7 +150,7 @@ private:
QLNode *locate( uint ); // get node at i'th pos QLNode *locate( uint ); // get node at i'th pos
QLNode *unlink(); // unlink node QLNode *unlink(); // unlink node
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
// QMutex* mutex; // QMutex* mutex;
#endif #endif

@ -51,9 +51,9 @@
#include "qdatastream.h" #include "qdatastream.h"
#include <stdlib.h> #include <stdlib.h>
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
# include <private/qmutexpool_p.h> # include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#define USE_MALLOC // comment to use new/delete #define USE_MALLOC // comment to use new/delete
@ -405,10 +405,10 @@ void QGVector::sort() // sort vector
} }
} }
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QMutexLocker locker( qt_global_mutexpool ? QMutexLocker locker( qt_global_mutexpool ?
qt_global_mutexpool->get( &sort_vec ) : 0 ); qt_global_mutexpool->get( &sort_vec ) : 0 );
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
sort_vec = (QGVector*)this; sort_vec = (QGVector*)this;
qsort( vec, count(), sizeof(Item), cmp_vec ); qsort( vec, count(), sizeof(Item), cmp_vec );

@ -3244,7 +3244,7 @@ QString QLocalePrivate::doubleToString(double d,
QString digits; QString digits;
#ifdef QT_QLOCALE_USES_FCVT #ifdef QT_QLOCALE_USES_FCVT
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
static bool dummy_for_mutex; static bool dummy_for_mutex;
QMutex *fcvt_mutex = qt_global_mutexpool ? qt_global_mutexpool->get( &dummy_for_mutex ) : 0; QMutex *fcvt_mutex = qt_global_mutexpool ? qt_global_mutexpool->get( &dummy_for_mutex ) : 0;
# define FCVT_LOCK if (fcvt_mutex) fcvt_mutex->lock() # define FCVT_LOCK if (fcvt_mutex) fcvt_mutex->lock()

@ -45,7 +45,7 @@
#include "qglobal.h" #include "qglobal.h"
#endif // QT_H #endif // QT_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
class QMutexPrivate; class QMutexPrivate;

@ -38,7 +38,7 @@
** **
**********************************************************************/ **********************************************************************/
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qplatformdefs.h" #include "qplatformdefs.h"
@ -720,4 +720,4 @@ int QMutex::level()
\sa QMutexLocker::QMutexLocker() \sa QMutexLocker::QMutexLocker()
*/ */
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT

@ -38,7 +38,7 @@
#include "qmutexpool_p.h" #include "qmutexpool_p.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include <qthread.h> #include <qthread.h>

@ -51,7 +51,7 @@
// //
// //
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#ifndef QT_H #ifndef QT_H
#include "qmutex.h" #include "qmutex.h"
@ -75,6 +75,6 @@ private:
extern Q_EXPORT QMutexPool *qt_global_mutexpool; extern Q_EXPORT QMutexPool *qt_global_mutexpool;
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#endif // QMUTEXPOOL_P_H #endif // QMUTEXPOOL_P_H

@ -52,10 +52,10 @@
#include "qstring.h" #include "qstring.h"
#include "qtl.h" #include "qtl.h"
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include "qthreadstorage.h" #include "qthreadstorage.h"
#include <private/qthreadinstance_p.h> #include <private/qthreadinstance_p.h>
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#undef QT_TRANSLATE_NOOP #undef QT_TRANSLATE_NOOP
#define QT_TRANSLATE_NOOP( context, sourceText ) sourceText #define QT_TRANSLATE_NOOP( context, sourceText ) sourceText
@ -3212,25 +3212,25 @@ struct QRegExpPrivate
#ifndef QT_NO_REGEXP_OPTIM #ifndef QT_NO_REGEXP_OPTIM
static QSingleCleanupHandler<QCache<QRegExpEngine> > cleanup_cache; static QSingleCleanupHandler<QCache<QRegExpEngine> > cleanup_cache;
# ifndef TQT_THREAD_SUPPORT # ifndef QT_THREAD_SUPPORT
static QCache<QRegExpEngine> *engineCache = 0; static QCache<QRegExpEngine> *engineCache = 0;
# endif // TQT_THREAD_SUPPORT # endif // QT_THREAD_SUPPORT
#endif // QT_NO_REGEXP_OPTIM #endif // QT_NO_REGEXP_OPTIM
static void regexpEngine( QRegExpEngine *&eng, const QString &pattern, static void regexpEngine( QRegExpEngine *&eng, const QString &pattern,
bool caseSensitive, bool deref ) bool caseSensitive, bool deref )
{ {
# ifdef TQT_THREAD_SUPPORT # ifdef QT_THREAD_SUPPORT
static QThreadStorage<QCache<QRegExpEngine> *> engineCaches; static QThreadStorage<QCache<QRegExpEngine> *> engineCaches;
QCache<QRegExpEngine> *engineCache = 0; QCache<QRegExpEngine> *engineCache = 0;
QThreadInstance *currentThread = QThreadInstance::current(); QThreadInstance *currentThread = QThreadInstance::current();
if (currentThread) if (currentThread)
engineCache = engineCaches.localData(); engineCache = engineCaches.localData();
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
if ( !deref ) { if ( !deref ) {
#ifndef QT_NO_REGEXP_OPTIM #ifndef QT_NO_REGEXP_OPTIM
# ifdef TQT_THREAD_SUPPORT # ifdef QT_THREAD_SUPPORT
if ( currentThread ) if ( currentThread )
# endif # endif
{ {
@ -3251,18 +3251,18 @@ static void regexpEngine( QRegExpEngine *&eng, const QString &pattern,
if ( eng->deref() ) { if ( eng->deref() ) {
#ifndef QT_NO_REGEXP_OPTIM #ifndef QT_NO_REGEXP_OPTIM
# ifdef TQT_THREAD_SUPPORT # ifdef QT_THREAD_SUPPORT
if ( currentThread ) if ( currentThread )
# endif # endif
{ {
if ( engineCache == 0 ) { if ( engineCache == 0 ) {
engineCache = new QCache<QRegExpEngine>; engineCache = new QCache<QRegExpEngine>;
engineCache->setAutoDelete( TRUE ); engineCache->setAutoDelete( TRUE );
# ifdef TQT_THREAD_SUPPORT # ifdef QT_THREAD_SUPPORT
engineCaches.setLocalData(engineCache); engineCaches.setLocalData(engineCache);
# else # else
cleanup_cache.set( &engineCache ); cleanup_cache.set( &engineCache );
# endif // !TQT_THREAD_SUPPORT # endif // !QT_THREAD_SUPPORT
} }
if ( !pattern.isNull() && if ( !pattern.isNull() &&
engineCache->insert(pattern, eng, 4 + pattern.length() / 4) ) engineCache->insert(pattern, eng, 4 + pattern.length() / 4) )

@ -38,7 +38,7 @@
** **
**********************************************************************/ **********************************************************************/
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qsemaphore.h" #include "qsemaphore.h"
#include "qmutex.h" #include "qmutex.h"
@ -252,4 +252,4 @@ bool QSemaphore::tryAccess(int n)
return TRUE; return TRUE;
} }
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT

@ -45,7 +45,7 @@
#include "qglobal.h" #include "qglobal.h"
#endif // QT_H #endif // QT_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
class QSemaphorePrivate; class QSemaphorePrivate;

@ -93,9 +93,9 @@
#define ULLONG_MAX Q_UINT64_C(18446744073709551615) #define ULLONG_MAX Q_UINT64_C(18446744073709551615)
#endif #endif
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#include "qmutex.h" #include "qmutex.h"
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
extern QMutex *qt_sharedStringMutex; extern QMutex *qt_sharedStringMutex;
@ -1053,9 +1053,9 @@ QStringData::QStringData() : QShared(),
maxl(0), maxl(0),
islatin1(FALSE), islatin1(FALSE),
security_unpaged(FALSE) { security_unpaged(FALSE) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new QMutex(FALSE); mutex = new QMutex(FALSE);
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
ref(); ref();
} }
@ -1067,9 +1067,9 @@ QStringData::QStringData(QChar *u, uint l, uint m) : QShared(),
maxl(m), maxl(m),
islatin1(FALSE), islatin1(FALSE),
security_unpaged(FALSE) { security_unpaged(FALSE) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new QMutex(FALSE); mutex = new QMutex(FALSE);
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
QStringData::~QStringData() { QStringData::~QStringData() {
@ -1084,12 +1084,12 @@ QStringData::~QStringData() {
if ( ascii ) { if ( ascii ) {
delete[] ascii; delete[] ascii;
} }
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if ( mutex ) { if ( mutex ) {
delete mutex; delete mutex;
mutex = NULL; mutex = NULL;
} }
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
void QStringData::setDirty() { void QStringData::setDirty() {
@ -1457,14 +1457,14 @@ QT_STATIC_CONST_IMPL QChar QChar::nbsp((ushort)0x00a0);
QStringData* QString::makeSharedNull() QStringData* QString::makeSharedNull()
{ {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if (qt_sharedStringMutex) qt_sharedStringMutex->lock(); if (qt_sharedStringMutex) qt_sharedStringMutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if (QString::shared_null) { if (QString::shared_null) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if (qt_sharedStringMutex) qt_sharedStringMutex->unlock(); if (qt_sharedStringMutex) qt_sharedStringMutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
return QString::shared_null; return QString::shared_null;
} }
@ -1474,9 +1474,9 @@ QStringData* QString::makeSharedNull()
that->d = QString::shared_null; that->d = QString::shared_null;
#endif #endif
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
if (qt_sharedStringMutex) qt_sharedStringMutex->unlock(); if (qt_sharedStringMutex) qt_sharedStringMutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
return QString::shared_null; return QString::shared_null;
} }
@ -1517,13 +1517,13 @@ QString::QString( const QString &s ) :
d(s.d) d(s.d)
{ {
if ( d && (d != shared_null) ) { if ( d && (d != shared_null) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->ref(); d->ref();
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
} }
@ -1676,20 +1676,20 @@ QString::~QString()
return; return;
} }
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) { if ( d->deref() ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->deleteSelf(); d->deleteSelf();
d = NULL; d = NULL;
} }
else { else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
} }
@ -1711,22 +1711,22 @@ void QString::real_detach()
void QString::deref() void QString::deref()
{ {
if ( d && (d != shared_null) ) { if ( d && (d != shared_null) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) { if ( d->deref() ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d != shared_null ) { if ( d != shared_null ) {
delete d; delete d;
} }
d = 0; d = 0;
} }
else { else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
} }
} }
@ -1769,13 +1769,13 @@ void QStringData::deleteSelf()
QString &QString::operator=( const QString &s ) QString &QString::operator=( const QString &s )
{ {
if ( s.d && (s.d != shared_null) ) { if ( s.d && (s.d != shared_null) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->lock(); s.d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
s.d->ref(); s.d->ref();
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->unlock(); s.d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
deref(); deref();
d = s.d; d = s.d;
@ -1883,9 +1883,9 @@ void QString::truncate( uint newLen )
*/ */
void QString::setLength( uint newLen ) void QString::setLength( uint newLen )
{ {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl || if ( d->count != 1 || newLen > d->maxl ||
( newLen * 4 < d->maxl && d->maxl > 4 ) ) { ( newLen * 4 < d->maxl && d->maxl > 4 ) ) {
@ -1896,24 +1896,24 @@ void QString::setLength( uint newLen )
uint len = QMIN( d->len, newLen ); uint len = QMIN( d->len, newLen );
memcpy( nd, d->unicode, sizeof(QChar) * len ); memcpy( nd, d->unicode, sizeof(QChar) * len );
bool unpaged = d->security_unpaged; bool unpaged = d->security_unpaged;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
deref(); deref();
d = new QStringData( nd, newLen, newMax ); d = new QStringData( nd, newLen, newMax );
setSecurityUnPaged(unpaged); setSecurityUnPaged(unpaged);
} }
else { else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
} }
else { else {
d->len = newLen; d->len = newLen;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->setDirty(); d->setDirty();
} }
} }
@ -1999,21 +1999,21 @@ void QString::squeeze()
*/ */
void QString::grow( uint newLen ) void QString::grow( uint newLen )
{ {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl ) { if ( d->count != 1 || newLen > d->maxl ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
setLength( newLen ); setLength( newLen );
} }
else { else {
d->len = newLen; d->len = newLen;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->setDirty(); d->setDirty();
} }
} }
@ -6423,19 +6423,19 @@ QString QString::fromUcs2( const unsigned short *str )
*/ */
QChar& QString::ref(uint i) { QChar& QString::ref(uint i) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( (d->count != 1) || (i >= d->len) ) { if ( (d->count != 1) || (i >= d->len) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
subat( i ); subat( i );
} }
else { else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
d->setDirty(); d->setDirty();
return d->unicode[i]; return d->unicode[i];
@ -6523,9 +6523,9 @@ QString& QString::setUnicode( const QChar *unicode, uint len )
} }
} }
else { else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || len > d->maxl || ( len * 4 < d->maxl && d->maxl > 4 ) ) { if ( d->count != 1 || len > d->maxl || ( len * 4 < d->maxl && d->maxl > 4 ) ) {
// detach, grown or shrink // detach, grown or shrink
uint newMax = computeNewMax( len ); uint newMax = computeNewMax( len );
@ -6533,17 +6533,17 @@ QString& QString::setUnicode( const QChar *unicode, uint len )
if ( unicode ) { if ( unicode ) {
memcpy( nd, unicode, sizeof(QChar)*len ); memcpy( nd, unicode, sizeof(QChar)*len );
} }
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
deref(); deref();
d = new QStringData( nd, len, newMax ); d = new QStringData( nd, len, newMax );
} }
else { else {
d->len = len; d->len = len;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
d->setDirty(); d->setDirty();
if ( unicode ) { if ( unicode ) {
memcpy( d->unicode, unicode, sizeof(QChar)*len ); memcpy( d->unicode, unicode, sizeof(QChar)*len );
@ -7254,9 +7254,9 @@ QConstString::QConstString( const QChar* unicode, uint length ) :
*/ */
QConstString::~QConstString() QConstString::~QConstString()
{ {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock(); d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
if ( d->count > 1 ) { if ( d->count > 1 ) {
QChar* cp = QT_ALLOC_QCHAR_VEC( d->len ); QChar* cp = QT_ALLOC_QCHAR_VEC( d->len );
@ -7268,9 +7268,9 @@ QConstString::~QConstString()
} }
// The original d->unicode is now unlinked. // The original d->unicode is now unlinked.
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock(); d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE #endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
} }
/*! /*!

@ -51,7 +51,7 @@
// //
// //
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#ifndef QT_H #ifndef QT_H
#include "qmutex.h" #include "qmutex.h"
@ -105,5 +105,5 @@ public:
bool disableThreadPostedEvents : 1; bool disableThreadPostedEvents : 1;
}; };
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#endif // QTHREAD_P_H #endif // QTHREAD_P_H

@ -39,7 +39,7 @@
#ifndef QTHREADSTORAGE_H #ifndef QTHREADSTORAGE_H
#define QTHREADSTORAGE_H #define QTHREADSTORAGE_H
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#ifndef QT_H #ifndef QT_H
#include "qglobal.h" #include "qglobal.h"
@ -90,6 +90,6 @@ public:
{ (void) d.set( t ); } { (void) d.set( t ); }
}; };
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT
#endif // QTHREADSTORAGE_H #endif // QTHREADSTORAGE_H

@ -36,7 +36,7 @@
** **
**********************************************************************/ **********************************************************************/
#ifdef TQT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
#include "qplatformdefs.h" #include "qplatformdefs.h"
@ -346,4 +346,4 @@ void QThreadStorageData::finish( void **thread_storage )
\sa localData() hasLocalData() \sa localData() hasLocalData()
*/ */
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT

@ -45,7 +45,7 @@
#include "qglobal.h" #include "qglobal.h"
#endif // QT_H #endif // QT_H
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include <limits.h> #include <limits.h>

@ -38,7 +38,7 @@
** **
**********************************************************************/ **********************************************************************/
#if defined(TQT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
#include "qplatformdefs.h" #include "qplatformdefs.h"
@ -313,4 +313,4 @@ bool QWaitCondition::wait(QMutex *mutex, unsigned long time)
return (ret == 0); return (ret == 0);
} }
#endif // TQT_THREAD_SUPPORT #endif // QT_THREAD_SUPPORT

Loading…
Cancel
Save