TQT_THREAD_SUPPORT->!TQT_NO_THREAD: migrate sources

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
fix/no-thread
Alexander Golubev 2 months ago
parent fa4475f36d
commit f7642b09c9

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

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

@ -99,9 +99,9 @@
#endif
#ifdef TQ_WS_WIN
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
# include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#endif // TQ_WS_WIN
#if !defined(Q_OS_TEMP)
@ -526,7 +526,7 @@ static void resolveLibs()
static bool triedResolve = FALSE;
if ( !triedResolve ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
// protect initialization
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &triedResolve ) : 0 );
@ -3196,7 +3196,7 @@ void TQFileDialog::setDir( const TQString & pathstr )
i++;
TQCString user;
if ( i == 1 ) {
#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
#if !defined(TQT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
# ifndef _POSIX_LOGIN_NAME_MAX
# define _POSIX_LOGIN_NAME_MAX 9
@ -3209,13 +3209,13 @@ void TQFileDialog::setDir( const TQString & pathstr )
#else
user = ::getlogin();
if ( !user )
#endif
#endif // !TQT_NO_THREAD && _POSIX_THREAD_SAFE_FUNCTIONS
user = getenv( "LOGNAME" );
} else
user = dr.mid( 1, i-1 ).local8Bit();
dr = dr.mid( i, dr.length() );
struct passwd *pw;
#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_OPENBSD)
#if !defined(TQT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_OPENBSD)
struct passwd mt_pw;
char buffer[2048];
if ( ::getpwnam_r( user, &mt_pw, buffer, 2048, &pw ) == 0 && pw == &mt_pw )

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

@ -61,10 +61,10 @@ class TQIMEvent;
class TQWSDecoration;
#endif
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
class TQMutex;
class TQThread;
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
class TQApplication;
@ -297,7 +297,7 @@ public:
static bool x11_apply_settings();
#endif
void wakeUpGuiThread();
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
void lock();
void unlock(bool wakeUpGui = TRUE);
bool locked();
@ -354,9 +354,9 @@ private slots:
#endif
public:
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
static TQMutex *tqt_mutex;
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
private:
int app_argc;
@ -372,7 +372,7 @@ private:
#ifndef TQT_NO_CURSOR
static TQCursor *app_cursor;
#endif
#ifndef TQT_THREAD_SUPPORT
#if defined(TQT_NO_THREAD)
static TQEventLoop* eventloop;
#endif
static int app_tracking;
@ -436,9 +436,9 @@ private:
friend class TQDialog;
friend class TQAccelManager;
friend class TQEvent;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
friend class TQThread;
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
friend class TQTranslator;
friend class TQEventLoop;
friend TQ_EXPORT void tqt_ucm_initialize( TQApplication * );
@ -458,7 +458,7 @@ private:
static TQEventLoop* currentEventLoop();
public:
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
static TQThread* guiThread();
static void threadTerminationHandler( TQThread * );
#endif

@ -59,10 +59,6 @@ struct timeval; //stdc struct
struct TimerInfo; //internal structure (qeventloop_mac.cpp)
#endif
#if defined(TQT_THREAD_SUPPORT)
class TQMutex;
#endif // TQT_THREAD_SUPPORT
class TQ_EXPORT TQEventLoop : public TQObject
{

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

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

@ -45,7 +45,7 @@
#include "ntqwindowdefs.h"
#endif // QT_H
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#include <limits.h>
@ -141,6 +141,6 @@ class TQ_EXPORT TQEventLoopThread : public TQThread
virtual void run();
};
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#endif // TQTHREAD_H

@ -65,11 +65,11 @@
#endif
#include "qfontdata_p.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
# include "ntqmutex.h"
# include "ntqthread.h"
# include <private/qthreadinstance_p.h>
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#include <stdlib.h>
@ -375,7 +375,7 @@ TQStringList *TQApplication::app_libpaths = 0;
bool TQApplication::metaComposeUnicode = FALSE;
int TQApplication::composedUnicode = 0;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutex *TQApplication::tqt_mutex = 0;
TQMutex *tqt_sharedStringMutex = 0;
TQ_EXPORT TQMutex * tqt_sharedMetaObjectMutex = 0;
@ -388,13 +388,11 @@ TQ_EXPORT TQt::HANDLE tqt_get_application_thread_id()
{
return tqt_application_thread_id;
}
#endif // TQT_THREAD_SUPPORT
#ifndef TQT_THREAD_SUPPORT
#else // !TQT_NO_THREAD
TQEventLoop *TQApplication::eventloop = 0; // application event loop
#endif
#endif // TQT_NO_THREAD
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQEventLoop* TQApplication::currentEventLoop() {
TQThread* thread = TQThread::currentThreadObject();
if (thread) {
@ -541,7 +539,7 @@ TQClipboard *tqt_clipboard = 0; // global clipboard object
#endif
TQWidgetList * tqt_modal_stack=0; // stack of modal widgets
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
// thread wrapper for the main() thread
class TQCoreApplicationThread : public TQThread
{
@ -603,9 +601,9 @@ static TQPostEventList *globalPostedEvents = 0; // list of posted events
uint qGlobalPostedEventsCount()
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if (!globalPostedEvents) {
return 0;
@ -1033,7 +1031,7 @@ TQApplication::TQApplication(Display *dpy, int argc, char **argv,
#endif // TQ_WS_X11
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQThread* TQApplication::guiThread() {
return mainThread();
}
@ -1067,7 +1065,7 @@ void TQApplication::init_precmdline()
void TQApplication::initialize( int argc, char **argv, bool enable_sm )
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
tqt_mutex = new TQMutex( TRUE );
tqt_sharedStringMutex = new TQMutex( TRUE );
tqt_sharedMetaObjectMutex = new TQMutex( TRUE );
@ -1076,7 +1074,7 @@ void TQApplication::initialize( int argc, char **argv, bool enable_sm )
#endif // QT_USE_GLIBMAINLOOP
postevent_mutex = new TQMutex( TRUE );
tqt_application_thread_id = TQThread::currentThread();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
app_argc = argc;
app_argv = argv;
@ -1224,12 +1222,12 @@ TQApplication::~TQApplication()
app_libpaths = 0;
#endif
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
delete tqt_mutex;
tqt_mutex = 0;
delete postevent_mutex;
postevent_mutex = 0;
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if( tqApp == this ) {
if ( postedEvents )
@ -1252,7 +1250,7 @@ TQApplication::~TQApplication()
session_key = 0;
#endif //TQT_NO_SESSIONMANAGER
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
delete tqt_sharedMetaObjectMutex;
tqt_sharedMetaObjectMutex = 0;
delete tqt_sharedStringMutex;
@ -1261,7 +1259,7 @@ TQApplication::~TQApplication()
delete tqt_timerListMutex;
tqt_timerListMutex = 0;
#endif // QT_USE_GLIBMAINLOOP
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
tqt_explicit_app_style = FALSE;
tqt_app_has_font = FALSE;
@ -2519,9 +2517,9 @@ bool TQApplication::notify( TQObject *receiver, TQEvent *e )
}
if ( e->type() == TQEvent::ChildRemoved && receiver->postedEvents) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if (globalPostedEvents) {
// the TQObject destructor calls TQObject::removeChild, which calls
@ -2866,7 +2864,7 @@ bool TQApplication::internalNotify( TQObject *receiver, TQEvent * e)
}
if (!handled) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
int locklevel = 0;
int llcount;
if (TQApplication::tqt_mutex) {
@ -2879,7 +2877,7 @@ bool TQApplication::internalNotify( TQObject *receiver, TQEvent * e)
}
#endif
consumed = receiver->event( e );
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (TQApplication::tqt_mutex) {
for (llcount=0; llcount<locklevel; llcount++) {
TQApplication::tqt_mutex->lock();
@ -3031,7 +3029,7 @@ int TQApplication::exec()
*/
void TQApplication::exit( int retcode )
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQThread* thread = tqApp->guiThread();
if (thread) {
if (thread->d) {
@ -3042,7 +3040,7 @@ void TQApplication::exit( int retcode )
}
#else
tqApp->eventLoop()->exit( retcode );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
/*!
@ -3367,9 +3365,9 @@ void TQApplication::postEvent( TQObject *receiver, TQEvent *event )
return;
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( !globalPostedEvents ) { // create list
globalPostedEvents = new TQPostEventList;
@ -3463,7 +3461,7 @@ void TQApplication::postEvent( TQObject *receiver, TQEvent *event )
l->append( pe );
globalPostedEvents->append( pe );
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
// Wake up the receiver thread event loop
TQThread* thread = receiver->contextThreadObject();
if (thread) {
@ -3516,7 +3514,7 @@ void TQApplication::sendPostedEvents( TQObject *receiver, int event_type )
sendPostedEvents( 0, TQEvent::ChildInserted );
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( postevent_mutex );
#endif
@ -3549,7 +3547,7 @@ void TQApplication::sendPostedEvents( TQObject *receiver, int event_type )
&& ( event_type == 0 // we send all types
|| event_type == pe->event->type() ) // we send THAT type
&& ( !pe->receiver->wasDeleted ) // don't send if receiver was deleted
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
// only send if active thread is receiver object owning thread
&& ( pe->receiver->contextThreadObject() == TQThread::currentThreadObject() )
#endif
@ -3579,9 +3577,9 @@ void TQApplication::sendPostedEvents( TQObject *receiver, int event_type )
}
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if ( locker.mutex() ) locker.mutex()->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
// after all that work, it's time to deliver the event.
if ( e->type() == TQEvent::Paint && r->isWidgetType() ) {
TQWidget * w = (TQWidget*)r;
@ -3593,9 +3591,9 @@ void TQApplication::sendPostedEvents( TQObject *receiver, int event_type )
sent = TRUE;
TQApplication::sendEvent( r, e );
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if ( locker.mutex() ) locker.mutex()->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
delete e;
// careful when adding anything below this point - the
@ -3654,9 +3652,9 @@ void TQApplication::removePostedEvents( TQObject *receiver, int event_type )
return;
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
// the TQObject destructor calls this function directly. this can
// happen while the event loop is in the middle of posting events,
@ -3707,9 +3705,9 @@ void TQApplication::removePostedEvent( TQEvent * event )
return;
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( postevent_mutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( !globalPostedEvents ) {
#if defined(QT_DEBUG)
@ -3804,7 +3802,7 @@ void TQApplication::removePostedEvent( TQEvent * event )
}
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
static void tqThreadTerminationHandlerRecursive( TQObject* object, TQThread* originThread, TQThread* destinationThread ) {
TQThread* objectThread = object->contextThreadObject();
if (objectThread && (objectThread == originThread)) {
@ -3845,7 +3843,7 @@ void TQApplication::threadTerminationHandler( TQThread *originThread ) {
tqThreadTerminationHandlerRecursive((*objectit), originThread, destinationThread);
}
}
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
/*!\internal
@ -4196,7 +4194,7 @@ bool TQApplication::desktopSettingsAware()
\sa lock(), unlock() \link threads.html Thread Support in TQt\endlink
*/
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
void TQApplication::lock()
{
tqt_mutex->lock();

@ -87,6 +87,7 @@
#include "ntqsettings.h"
#include "ntqstylefactory.h"
#include "ntqfileinfo.h"
#include "ntqthread.h"
// Input method stuff - UNFINISHED
#ifndef TQT_NO_IM
@ -94,9 +95,6 @@
#endif // TQT_NO_IM
#include "qinternal_p.h" // shared double buffer cleanup
#if defined(TQT_THREAD_SUPPORT)
# include "ntqthread.h"
#endif
#if defined(QT_DEBUG) && defined(Q_OS_LINUX)
# include "ntqfile.h"
@ -1657,7 +1655,7 @@ void tqt_init_internal( int *argcptr, char **argv,
setlocale( LC_ALL, "" ); // use correct char set mapping
setlocale( LC_NUMERIC, "C" ); // make sprintf()/scanf() work
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (( tqt_is_gui_used ) && ( !display )) {
// If TQt is running standalone with a GUI, initialize X11 threading
XInitThreads();
@ -2220,7 +2218,7 @@ void tqt_init_internal( int *argcptr, char **argv,
TQPainter::initialize();
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
TQThread::initialize();
#endif
@ -2508,7 +2506,7 @@ void tqt_cleanup()
TQColor::cleanup();
TQSharedDoubleBuffer::cleanup();
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
TQThread::cleanup();
#endif

@ -41,7 +41,7 @@
#include "ntqapplication.h"
#include "ntqdatetime.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
# include "ntqthread.h"
# include "private/qthreadinstance_p.h"
#endif
@ -107,18 +107,18 @@ TQEventLoop::TQEventLoop( TQObject *parent, const char *name )
#if defined(QT_CHECK_STATE)
if ( TQApplication::currentEventLoop() )
tqFatal( "TQEventLoop: there must be only one event loop object per thread. \nIf this is supposed to be the main GUI event loop, construct it before TQApplication." );
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (!TQThread::currentThreadObject()) {
tqFatal( "TQEventLoop: this object can only be used in threads constructed via TQThread." );
}
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#endif // QT_CHECK_STATE
d = new TQEventLoopPrivate;
init();
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQThread* thread = TQThread::currentThreadObject();
if (thread) {
if (thread->d) {
@ -137,7 +137,7 @@ TQEventLoop::~TQEventLoop()
{
cleanup();
delete d;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQThread* thread = TQThread::currentThreadObject();
if (thread) {
if (thread->d) {

@ -45,21 +45,18 @@
#include "ntqapplication.h"
#include "ntqbitarray.h"
#include "ntqmutex.h"
#if defined(TQT_THREAD_SUPPORT)
#include "ntqthread.h"
#endif
#include "ntqthread.h"
#include <stdlib.h>
#include <sys/types.h>
#include <glib.h>
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#ifdef QT_USE_GLIBMAINLOOP
extern TQMutex *tqt_timerListMutex;
#endif // QT_USE_GLIBMAINLOOP
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
/*****************************************************************************
Timer handling; UNIX has no application timer support so we'll have to
@ -186,7 +183,7 @@ static int allocTimerId() // find avail timer identifier
static void insertTimer( const TimerInfo *ti ) // insert timer info into list
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->lock();
#endif
TimerInfo *t = timerList->first();
@ -209,7 +206,7 @@ static void insertTimer( const TimerInfo *ti ) // insert timer info into list
tqDebug( "TQObject: %d timers now exist for object %s::%s", dangerCount, ti->obj->className(), ti->obj->name() );
}
#endif
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->unlock();
#endif
}
@ -235,7 +232,7 @@ static inline void getTime( timeval &t ) // get time of day
static void repairTimer( const timeval &time ) // repair broken timer
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->lock();
#endif
timeval diff = watchtime - time;
@ -244,7 +241,7 @@ static void repairTimer( const timeval &time ) // repair broken timer
t->timeout = t->timeout - diff;
t = timerList->next();
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->unlock();
#endif
}
@ -262,7 +259,7 @@ static void repairTimer( const timeval &time ) // repair broken timer
timeval *qt_wait_timer()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->lock();
#endif
static timeval tm;
@ -288,19 +285,19 @@ timeval *qt_wait_timer()
if ( qt_wait_timer_max && *qt_wait_timer_max < tm ) {
tm = *qt_wait_timer_max;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->unlock();
#endif
return &tm;
}
if ( qt_wait_timer_max ) {
tm = *qt_wait_timer_max;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->unlock();
#endif
return &tm;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex->unlock();
#endif
return 0; // no timers
@ -316,7 +313,7 @@ static void initTimers() // initialize timers
timerBitVec->clearBit( i );
}
timerList = new TimerList;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
tqt_timerListMutex = new TQMutex(true);
#endif
TQ_CHECK_PTR( timerList );
@ -336,18 +333,18 @@ void cleanupTimers()
// Main timer functions for starting and killing timers
int qStartTimer( int interval, TQObject *obj )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->lock();
#endif
if ( !timerList ) { // initialize timer data
initTimers();
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->lock();
#endif
}
int id = allocTimerId(); // get free timer id
if ( (id <= 0) || (id > (int)timerBitVec->size()) || (!obj) ) { // cannot create timer
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return 0;
@ -363,7 +360,7 @@ int qStartTimer( int interval, TQObject *obj )
t->timeout = currentTime + t->interval;
t->obj = obj;
insertTimer( t ); // put timer in list
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return id;
@ -371,12 +368,12 @@ int qStartTimer( int interval, TQObject *obj )
bool qKillTimer( int id )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->lock();
#endif
TimerInfo *t;
if ( (!timerList) || (id <= 0) || (id > (int)timerBitVec->size()) || (!timerBitVec->testBit( id-1 )) ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return FALSE; // not init'd or invalid timer
@ -389,13 +386,13 @@ bool qKillTimer( int id )
bool ret;
timerBitVec->clearBit( id-1 ); // set timer inactive
ret = timerList->remove();
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return ret;
}
else { // id not found
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return FALSE;
@ -404,12 +401,12 @@ bool qKillTimer( int id )
bool qKillTimer( TQObject *obj )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->lock();
#endif
TimerInfo *t;
if ( !timerList ) { // not initialized
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return FALSE;
@ -425,7 +422,7 @@ bool qKillTimer( TQObject *obj )
t = timerList->next();
}
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return TRUE;
@ -632,11 +629,11 @@ int TQEventLoop::timeToWait() const
int TQEventLoop::activateTimers()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->lock();
#endif
if ( !timerList || !timerList->count() ) { // no timers
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return 0;
@ -682,11 +679,10 @@ int TQEventLoop::activateTimers()
if ( t->interval.tv_usec > 0 || t->interval.tv_sec > 0 ) {
n_act++;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
TQTimerEvent e( t->id );
#if defined(TQT_THREAD_SUPPORT)
// Be careful...the current thread may not be the target object's thread!
if ((!t->obj) ||
(TQThread::currentThreadObject() && TQThread::currentThreadObject()->threadPostedEventsDisabled()) ||
@ -696,17 +692,15 @@ int TQEventLoop::activateTimers()
else {
TQApplication::postEvent( t->obj, new TQTimerEvent(e) ); // post event to correct thread
}
#else // defined(TQT_THREAD_SUPPORT)
TQApplication::sendEvent( t->obj, &e ); // send event
#endif // defined(TQT_THREAD_SUPPORT)
#if defined(TQT_THREAD_SUPPORT)
if (tqt_timerListMutex) tqt_timerListMutex->lock();
#endif
#else // !TQT_NO_THREAD
TQApplication::sendEvent( t->obj, &e ); // send event
#endif // TQT_NO_THREAD
if ( timerList->findRef( begin ) == -1 ) {
begin = 0;
}
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (tqt_timerListMutex) tqt_timerListMutex->unlock();
#endif
return n_act;
@ -731,7 +725,7 @@ int TQEventLoop::activateSocketNotifiers()
printf("activate sn : send event fd=%d\n", sn->gPollFD.fd );
#endif
sn->pending = FALSE;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
// Be careful...the current thread may not be the target object's thread!
if ((!sn->obj) ||
(TQThread::currentThreadObject() && TQThread::currentThreadObject()->threadPostedEventsDisabled()) ||
@ -741,9 +735,9 @@ int TQEventLoop::activateSocketNotifiers()
else {
TQApplication::postEvent( sn->obj, new TQEvent(event) ); // post event to correct thread
}
#else // defined(TQT_THREAD_SUPPORT)
#else // !TQT_NO_THREAD
TQApplication::sendEvent( sn->obj, &event ); // send event
#endif // defined(TQT_THREAD_SUPPORT)
#endif // TQT_NO_THREAD
n_act++;
}
}

@ -40,12 +40,10 @@
#include "ntqeventloop.h"
#include "ntqapplication.h"
#include "ntqbitarray.h"
#include "ntqmutex.h"
#include "qcolor_p.h"
#include "qt_x11_p.h"
#if defined(TQT_THREAD_SUPPORT)
# include "ntqmutex.h"
#endif // TQT_THREAD_SUPPORT
#include <errno.h>
@ -138,7 +136,7 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags )
XEvent event;
int nevents = 0;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
TQMutexLocker locker( TQApplication::tqt_mutex );
#endif
@ -283,7 +281,7 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags )
// unlock the GUI mutex and select. when we return from this function, there is
// something for us to do
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if ( locker.mutex() ) locker.mutex()->unlock();
else return false;
#endif
@ -298,7 +296,7 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags )
} while (nsel == -1 && (errno == EINTR || errno == EAGAIN));
// relock the GUI mutex before processing any pending events
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if ( locker.mutex() ) locker.mutex()->lock();
else return false;
#endif

@ -43,14 +43,11 @@
#include "ntqeventloop.h"
#include "ntqapplication.h"
#include "ntqbitarray.h"
#include "ntqmutex.h"
#include "ntqthread.h"
#include "qcolor_p.h"
#include "qt_x11_p.h"
#if defined(TQT_THREAD_SUPPORT)
# include "ntqmutex.h"
# include "ntqthread.h"
#endif // TQT_THREAD_SUPPORT
#include <errno.h>
#include <glib.h>
@ -295,7 +292,7 @@ bool TQEventLoop::processX11Events()
XEvent event;
int nevents = 0;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
TQMutexLocker locker( TQApplication::tqt_mutex );
#endif
@ -383,7 +380,7 @@ bool TQEventLoop::gsourcePrepare(GSource *gs, int * timeout)
ProcessEventsFlags flags = d->pev_flags;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
TQMutexLocker locker( TQApplication::tqt_mutex );
#endif
@ -535,10 +532,8 @@ bool TQEventLoop::gsourceDispatch(GSource *gs) {
Q_UNUSED(gs);
// relock the GUI mutex before processing any pending events
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
TQMutexLocker locker( TQApplication::tqt_mutex );
#endif
#if defined(TQT_THREAD_SUPPORT)
if (locker.mutex()) locker.mutex()->lock();
#endif
@ -608,13 +603,13 @@ bool TQEventLoop::gsourceDispatch(GSource *gs) {
// color approx. optimization - only on X11
qt_reset_color_avail();
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (locker.mutex()) locker.mutex()->unlock();
#endif
processX11Events();
}
else {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
if (locker.mutex()) locker.mutex()->unlock();
#endif
}
@ -629,9 +624,9 @@ bool TQEventLoop::gsourceDispatch(GSource *gs) {
bool TQEventLoop::hasPendingEvents() const
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( TQApplication::tqt_mutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
extern uint qGlobalPostedEventsCount(); // from qapplication.cpp
return ( qGlobalPostedEventsCount() || ( (tqt_is_gui_used && TQApplication::isGuiThread()) ? XPending( TQPaintDevice::x11AppDisplay() ) : 0));

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

@ -41,9 +41,9 @@
#include "ntqmetaobject.h"
#include "ntqasciidict.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
/*!
\class TQMetaData ntqmetaobject.h
@ -282,10 +282,10 @@ TQMetaObject::~TQMetaObject()
delete slotDict; // delete dicts
delete signalDict;
delete d;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( qt_metaobjects ) {
qt_metaobjects->remove( classname );
if ( qt_metaobjects->isEmpty() ) {
@ -799,10 +799,10 @@ TQMetaObject *TQMetaObject::metaObject( const char *class_name )
{
if ( !qt_metaobjects )
return 0;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
TQtStaticMetaObjectFunction func = (TQtStaticMetaObjectFunction)qt_metaobjects->find( class_name );
if ( func )
return func();
@ -814,10 +814,10 @@ bool TQMetaObject::hasMetaObject( const char *class_name )
{
if ( !qt_metaobjects )
return FALSE;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
return !!qt_metaobjects->find( class_name );
}
@ -1204,10 +1204,10 @@ bool TQMetaProperty::reset( TQObject* o ) const
TQMetaObjectCleanUp::TQMetaObjectCleanUp( const char *mo_name, TQtStaticMetaObjectFunction func )
: metaObject( 0 )
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( !qt_metaobjects )
qt_metaobjects = new TQAsciiDict<void>( 257 );
qt_metaobjects->insert( mo_name, (void*)func );
@ -1226,10 +1226,10 @@ TQMetaObjectCleanUp::TQMetaObjectCleanUp()
TQMetaObjectCleanUp::~TQMetaObjectCleanUp()
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &qt_metaobjects ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( !--qt_metaobjects_count ) {
delete qt_metaobjects;
qt_metaobjects = 0;

@ -52,7 +52,7 @@
// TQStyleControlElementData
#include "ntqstyle.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#include "ntqmutex.h"
#include <private/qmutexpool_p.h>
#include "ntqthread.h"
@ -105,7 +105,7 @@ class TQObjectPrivate {
public:
#ifndef TQT_NO_USERDATA
TQObjectPrivate( uint s ) : TQPtrVector<TQObjectUserData>(s) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
ownThread = NULL;
disableThreadPostedEvents = false;
#endif
@ -118,7 +118,7 @@ public:
delete controlElementDataPrivate;
}
#endif
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQThread* ownThread;
TQMutex* senderObjectListMutex;
TQMutex* childObjectListMutex;
@ -142,16 +142,14 @@ TQStyleControlElementDataPrivate* TQObject::controlElementDataPrivateObject() {
return d->controlElementDataPrivate;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
void TQObject::moveToThread_helper(TQThread *targetThread)
{
TQEvent e(TQEvent::ThreadChange);
TQApplication::sendEvent(this, &e);
#ifdef TQT_THREAD_SUPPORT
TQMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT
if (childObjects) {
TQObject *child;
@ -167,9 +165,7 @@ void TQObject::setThreadObject_helper(TQThread *targetThread)
{
d->ownThread = targetThread;
#ifdef TQT_THREAD_SUPPORT
TQMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT
if (childObjects) {
TQObject *child;
@ -197,9 +193,7 @@ void TQObject::setThreadObject_helper(TQThread *targetThread)
*/
void TQObject::moveToThread(TQThread *targetThread)
{
#ifdef TQT_THREAD_SUPPORT
TQMutexLocker locker( TQApplication::tqt_mutex );
#endif // TQT_THREAD_SUPPORT
if (parentObj) {
#if defined(QT_DEBUG)
@ -252,7 +246,7 @@ void TQObject::disableThreadPostedEvents(bool disable) {
d->disableThreadPostedEvents = disable;
}
#endif // defined(TQT_THREAD_SUPPORT)
#endif // TQT_NO_THREAD)
class TQSenderObjectList : public TQObjectList, public TQShared
{
@ -262,19 +256,19 @@ class TQSenderObjectList : public TQObjectList, public TQShared
public:
TQObject *currentSender;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutex *listMutex;
#endif
};
TQSenderObjectList::TQSenderObjectList() : currentSender( 0 ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
listMutex = new TQMutex( TRUE );
#endif
}
TQSenderObjectList::~TQSenderObjectList() {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
delete listMutex;
#endif
}
@ -509,7 +503,7 @@ void *tqt_find_obj_child( TQObject *parent, const char *type, const char *name )
return 0;
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
/*!
Returns a pointer to the TQThread* associated with
@ -548,12 +542,12 @@ static void qt_spy_signal( TQObject* sender, int signal, TQUObject* o )
s.sprintf( "%s_%s", mo->className(), sigData->name );
int slot = tqt_preliminary_signal_spy->metaObject()->findSlot( s, TRUE );
if ( slot >= 0 ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
// protect access to qt_spy_signal_sender
void * const address = &qt_spy_signal_sender;
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( address ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
TQObject* old_sender = qt_spy_signal_sender;
qt_spy_signal_sender = sender;
@ -572,7 +566,7 @@ static void qt_spy_signal( TQObject* sender, int signal, TQUObject* o )
static TQObjectList* object_trees = 0;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
static TQMutex *obj_trees_mutex = 0;
#endif
@ -580,7 +574,7 @@ static void cleanup_object_trees()
{
delete object_trees;
object_trees = 0;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
delete obj_trees_mutex;
obj_trees_mutex = 0;
#endif
@ -594,7 +588,7 @@ static void ensure_object_trees()
static void insert_tree( TQObject* obj )
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if ( !obj_trees_mutex )
obj_trees_mutex = new TQMutex();
TQMutexLocker locker( obj_trees_mutex );
@ -607,7 +601,7 @@ static void insert_tree( TQObject* obj )
static void remove_tree( TQObject* obj )
{
if ( object_trees ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( obj_trees_mutex );
#endif
object_trees->removeRef( obj );
@ -685,7 +679,7 @@ TQObject::TQObject( TQObject *parent, const char *name )
d = new TQObjectPrivate(0);
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
d->ownThread = TQThread::currentThreadObject();
d->senderObjectListMutex = new TQMutex( TRUE );
d->childObjectListMutex = new TQMutex( TRUE );
@ -777,7 +771,7 @@ TQObject::~TQObject()
while( (c=cit.current()) ) { // for each connected slot...
++cit;
if ( (obj=c->object()) ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQ_NO_THREAD
TQMutexLocker locker( obj->senderObjects->listMutex );
#endif
removeObjFromList( obj->senderObjects, this );
@ -804,10 +798,10 @@ TQObject::~TQObject()
delete childObjects;
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
delete d->childObjectListMutex;
delete d->senderObjectListMutex;
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
delete d;
}
@ -1099,25 +1093,25 @@ bool TQObject::event( TQEvent *e )
{
TQMetaCallEvent* metaEvent = dynamic_cast<TQMetaCallEvent*>(e);
if (metaEvent) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if ((d->disableThreadPostedEvents)
|| (d->ownThread == TQThread::currentThreadObject()))
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
{
TQSenderObjectList* sol;
TQObject* oldSender = 0;
sol = senderObjects;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( sol ) {
oldSender = sol->currentSender;
sol->ref();
sol->currentSender = metaEvent->sender();
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
TQUObject *o = metaEvent->data();
if (metaEvent->type() == TQMetaCallEvent::MetaCallEmit) {
tqt_emit( metaEvent->id(), o );
@ -1125,28 +1119,28 @@ bool TQObject::event( TQEvent *e )
if (metaEvent->type() == TQMetaCallEvent::MetaCallInvoke) {
tqt_invoke( metaEvent->id(), o );
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if (sol ) {
sol->currentSender = oldSender;
if ( sol->deref() ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
delete sol;
sol = NULL;
}
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (sol) sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
else {
tqWarning("TQObject: Ignoring metacall event from non-owning thread");
}
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
destroyDeepCopiedTQUObjectArray(metaEvent->data());
}
}
@ -1648,9 +1642,9 @@ TQConnectionList *TQObject::receivers( int signal ) const
void TQObject::insertChild( TQObject *obj )
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( obj->isTree ) {
remove_tree( obj );
@ -1694,9 +1688,9 @@ void TQObject::insertChild( TQObject *obj )
void TQObject::removeChild( TQObject *obj )
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( d->childObjectListMutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( childObjects && childObjects->removeRef(obj) ) {
obj->parentObj = 0;
@ -1934,12 +1928,12 @@ const TQObject *TQObject::sender()
{
#ifndef TQT_NO_PRELIMINARY_SIGNAL_SPY
if ( this == tqt_preliminary_signal_spy ) {
# ifdef TQT_THREAD_SUPPORT
# ifndef TQT_NO_THREAD
// protect access to qt_spy_signal_sender
void * const address = &qt_spy_signal_sender;
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( address ) : 0 );
# endif // TQT_THREAD_SUPPORT
# endif // TQT_NO_THREAD
return qt_spy_signal_sender;
}
#endif
@ -2282,24 +2276,24 @@ void TQObject::connectInternal( const TQObject *sender, int signal_index, const
TQ_CHECK_PTR( c );
clist->append( c );
if ( !r->senderObjects ) { // create list of senders
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
r->d->senderObjectListMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
r->senderObjects = new TQSenderObjectList;
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
r->senderObjects->listMutex->lock();
r->d->senderObjectListMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
else {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
r->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
r->senderObjects->append( s ); // add sender to list
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
r->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
@ -2505,25 +2499,25 @@ bool TQObject::disconnectInternal( const TQObject *sender, int signal_index,
c = clist->first();
while ( c ) { // for all receivers...
if ( r == 0 ) { // remove all receivers
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
removeObjFromList( c->object()->senderObjects, s );
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
success = TRUE;
c = clist->next();
} else if ( r == c->object() &&
( (member_index == -1) ||
((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
removeObjFromList( c->object()->senderObjects, s, TRUE );
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
success = TRUE;
clist->remove();
c = clist->current();
@ -2542,25 +2536,25 @@ bool TQObject::disconnectInternal( const TQObject *sender, int signal_index,
c = clist->first();
while ( c ) { // for all receivers...
if ( r == 0 ) { // remove all receivers
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
removeObjFromList( c->object()->senderObjects, s, TRUE );
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
success = TRUE;
c = clist->next();
} else if ( r == c->object() &&
( (member_index == -1) ||
((member_index == c->member()) && (c->memberType() == membcode)) ) ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
removeObjFromList( c->object()->senderObjects, s, TRUE );
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (c->object()->senderObjects) c->object()->senderObjects->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
success = TRUE;
clist->remove();
c = clist->current();
@ -2791,10 +2785,10 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
}
#endif
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
// NOTE currentThread could be NULL if the current thread was not started using the TQThread API
const TQThread *currentThread = TQThread::currentThreadObject();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
// Some slots are deleting the sender. It's not that great, but it's widespread enough,
// so we can't track all such issues. So, we have to workaround this somehow.
@ -2813,15 +2807,15 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
TQObject *oldSender;
TQSenderObjectList* sol = object->senderObjects;
if ( sol ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
sol->listMutex->lock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
oldSender = sol->currentSender;
sol->ref();
sol->currentSender = this;
}
if ( c->memberType() == TQ_SIGNAL_CODE ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if ((d->disableThreadPostedEvents) ||
(object->d->disableThreadPostedEvents) ||
(currentThread && currentThread->threadPostedEventsDisabled()) ||
@ -2839,12 +2833,12 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
TQApplication::postEvent(object, new TQMetaCallEvent(c->member(), this, deepCopyTQUObjectArray(o), TQMetaCallEvent::MetaCallEmit));
}
}
#else // !TQT_THREAD_SUPPORT
#else // !TQT_NO_THREAD
object->tqt_emit( c->member(), o );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
else {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if ((d->disableThreadPostedEvents) ||
(object->d->disableThreadPostedEvents) ||
(currentThread && currentThread->threadPostedEventsDisabled()) ||
@ -2862,23 +2856,23 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o )
TQApplication::postEvent(object, new TQMetaCallEvent(c->member(), this, deepCopyTQUObjectArray(o), TQMetaCallEvent::MetaCallInvoke));
}
}
#else // !TQT_THREAD_SUPPORT
#else // !TQT_NO_THREAD
object->tqt_invoke( c->member(), o );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
if ( sol ) {
sol->currentSender = oldSender;
if ( sol->deref() ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
delete sol;
sol = NULL;
}
}
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
if (sol) sol->listMutex->unlock();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
}
// use a copy of the pointer here as at this point this might be already deleted; no pun intended ;)
@ -3021,9 +3015,9 @@ void TQObject::dumpObjectTree()
void TQObject::dumpObjectInfo()
{
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( d->senderObjectListMutex );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#if defined(QT_DEBUG)
tqDebug( "OBJECT %s::%s", className(), name( "unnamed" ) );

@ -38,7 +38,7 @@
#include "ntqglobal.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@ -130,9 +130,7 @@
TQThread::TQThread()
{
#ifdef TQT_THREAD_SUPPORT
TQMutexLocker locker( TQApplication::tqt_mutex );
#endif // TQT_THREAD_SUPPORT
d = new TQThreadInstance;
d->init(0);
@ -270,4 +268,4 @@ void TQEventLoopThread::run()
if (eventLoop) eventLoop->exec();
}
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD

@ -38,7 +38,7 @@
#include "ntqglobal.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@ -563,4 +563,4 @@ TQThread *TQThread::currentThreadObject()
}
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD

@ -56,7 +56,7 @@
#include "ntqstyle.h"
#include "ntqmetaobject.h"
#include "ntqguardedptr.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#include "ntqthread.h"
#endif
#if defined(QT_ACCESSIBILITY_SUPPORT)
@ -890,7 +890,7 @@ TQWidget::TQWidget( TQWidget *parent, const char *name, WFlags f, NFlags n )
}
#endif
#if defined(TQT_THREAD_SUPPORT) && defined(QT_CHECK_STATE)
#if !defined(TQT_NO_THREAD) && defined(QT_CHECK_STATE)
if (TQThread::currentThreadObject() != TQApplication::guiThread()) {
tqFatal( "TQWidget: Cannot create a TQWidget outside of the main GUI thread" );
}

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

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

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

@ -45,7 +45,7 @@
#include "ntqglobal.h"
#endif // QT_H
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
class TQMutexPrivate;

@ -45,7 +45,7 @@
#include "ntqglobal.h"
#endif // QT_H
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
class TQSemaphorePrivate;

@ -43,7 +43,7 @@
#include "ntqglobal.h"
#endif // QT_H
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
class TQ_EXPORT TQThreadStorageData
{
@ -90,6 +90,6 @@ public:
{ (void) d.set( t ); }
};
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#endif // TQTHREADSTORAGE_H

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

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

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

@ -38,7 +38,7 @@
#include "ntqglobal.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#include "qt_windows.h"

@ -56,7 +56,7 @@
#include "ntqglobal.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#if defined(TQ_WS_WIN)

@ -43,9 +43,9 @@
#include "ntqregexp.h"
#include "ntqdatastream.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
# include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#include <stdio.h>
#include <stdarg.h>
@ -312,10 +312,10 @@ TQ_UINT16 tqChecksum( const char *data, uint len )
{
if ( !crc_tbl_init ) { // create lookup table
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &crc_tbl_init ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( !crc_tbl_init ) {
createCRC16Table();

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

@ -48,9 +48,9 @@
#include "ntqregexp.h"
#include "ntqstringlist.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
# include <private/qmutexpool_p.h>
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#include <stdlib.h>
#include <limits.h>
@ -238,7 +238,7 @@ bool TQDir::readDirEntries( const TQString &nameFilter,
if ( !dir )
return FALSE; // cannot read the directory
#if defined(TQT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
#if !defined(TQT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
union {
struct dirent mt_file;
char b[sizeof(struct dirent) + MAXNAMLEN + 1];
@ -246,7 +246,7 @@ bool TQDir::readDirEntries( const TQString &nameFilter,
while ( readdir_r(dir, &u.mt_file, &file ) == 0 && file )
#else
while ( (file = readdir(dir)) )
#endif // TQT_THREAD_SUPPORT && _POSIX_THREAD_SAFE_FUNCTIONS
#endif // !TQT_NO_THREAD && _POSIX_THREAD_SAFE_FUNCTIONS
{
TQString fn = TQFile::decodeName(file->d_name);
fi.setFile( *this, fn );
@ -312,10 +312,10 @@ const TQFileInfoList * TQDir::drives()
if ( !knownMemoryLeak ) {
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
TQMutexLocker locker( tqt_global_mutexpool ?
tqt_global_mutexpool->get( &knownMemoryLeak ) : 0 );
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( !knownMemoryLeak ) {
knownMemoryLeak = new TQFileInfoList;

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

@ -43,9 +43,7 @@
#include "ntqdatastream.h"
#include "ntqvaluelist.h"
#if defined(TQT_THREAD_SUPPORT)
#include "ntqmutex.h"
#endif // defined(TQT_THREAD_SUPPORT)
#include "ntqmutex.h"
/*!
\class TQLNode ntqglist.h
@ -225,7 +223,7 @@ TQDataStream &TQGList::write( TQDataStream &s, TQPtrCollection::Item ) const
TQGList::TQGList()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex = new TQMutex(true);
#endif
firstNode = lastNode = curNode = 0; // initialize list
@ -241,7 +239,7 @@ TQGList::TQGList()
TQGList::TQGList( const TQGList & list )
: TQPtrCollection( list )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex = new TQMutex(true);
#endif
firstNode = lastNode = curNode = 0; // initialize list
@ -268,7 +266,7 @@ TQGList::~TQGList()
// twice on the same address! This is insane but let's try not to crash
// here.
iterators = 0;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//delete mutex;
#endif
}
@ -337,11 +335,11 @@ bool TQGList::operator==( const TQGList &list ) const
TQLNode *TQGList::locate( uint index )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( index == (uint)curIndex ) { // current node ?
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode;
@ -355,7 +353,7 @@ TQLNode *TQGList::locate( uint index )
bool forward; // direction to traverse
if ( index >= numNodes ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -388,7 +386,7 @@ TQLNode *TQGList::locate( uint index )
}
}
curIndex = index; // must update index
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode = node;
@ -401,7 +399,7 @@ TQLNode *TQGList::locate( uint index )
void TQGList::inSort( TQPtrCollection::Item d )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
int index = 0;
@ -411,7 +409,7 @@ void TQGList::inSort( TQPtrCollection::Item d )
index++;
}
insertAt( index, d );
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@ -423,7 +421,7 @@ void TQGList::inSort( TQPtrCollection::Item d )
void TQGList::prepend( TQPtrCollection::Item d )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = new TQLNode( newItem(d) );
@ -436,7 +434,7 @@ void TQGList::prepend( TQPtrCollection::Item d )
firstNode = curNode = n; // curNode affected
numNodes++;
curIndex = 0;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@ -448,7 +446,7 @@ void TQGList::prepend( TQPtrCollection::Item d )
void TQGList::append( TQPtrCollection::Item d )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = new TQLNode( newItem(d) );
@ -463,7 +461,7 @@ void TQGList::append( TQPtrCollection::Item d )
lastNode = curNode = n; // curNode affected
curIndex = numNodes;
numNodes++;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@ -475,26 +473,26 @@ void TQGList::append( TQPtrCollection::Item d )
bool TQGList::insertAt( uint index, TQPtrCollection::Item d )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( index == 0 ) {
prepend( d );
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
}
else if ( index == numNodes ) {
append( d );
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
}
TQLNode *nextNode = locate( index );
if ( !nextNode ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
@ -509,7 +507,7 @@ bool TQGList::insertAt( uint index, TQPtrCollection::Item d )
n->next = nextNode;
curNode = n; // curIndex set by locate()
numNodes++;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@ -522,11 +520,11 @@ bool TQGList::insertAt( uint index, TQPtrCollection::Item d )
void TQGList::relinkNode( TQLNode *n )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( n == firstNode ) { // already first
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return;
@ -543,7 +541,7 @@ void TQGList::relinkNode( TQLNode *n )
firstNode = curNode = n; // curNode affected
numNodes++;
curIndex = 0;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@ -555,11 +553,11 @@ void TQGList::relinkNode( TQLNode *n )
TQLNode *TQGList::unlink()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( curNode == 0 ) { // null current node
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -593,7 +591,7 @@ TQLNode *TQGList::unlink()
iterators->notifyRemove( n, curNode );
}
numNodes--;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return n;
@ -606,7 +604,7 @@ TQLNode *TQGList::unlink()
bool TQGList::removeNode( TQLNode *n )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
#if defined(QT_CHECK_NULL)
@ -622,7 +620,7 @@ bool TQGList::removeNode( TQLNode *n )
delete n;
curNode = firstNode;
curIndex = curNode ? 0 : -1;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@ -636,25 +634,25 @@ bool TQGList::removeNode( TQLNode *n )
bool TQGList::remove( TQPtrCollection::Item d )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( d && find(d) == -1 ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
TQLNode *n = unlink();
if ( !n ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
deleteItem( n->data );
delete n;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@ -666,25 +664,25 @@ bool TQGList::remove( TQPtrCollection::Item d )
bool TQGList::removeRef( TQPtrCollection::Item d )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( findRef(d) == -1 ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
TQLNode *n = unlink();
if ( !n ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
deleteItem( n->data );
delete n;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@ -708,25 +706,25 @@ bool TQGList::removeRef( TQPtrCollection::Item d )
bool TQGList::removeAt( uint index )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( !locate(index) ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
TQLNode *n = unlink();
if ( !n ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
}
deleteItem( n->data );
delete n;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@ -738,12 +736,12 @@ bool TQGList::removeAt( uint index )
*/
bool TQGList::replaceAt( uint index, TQPtrCollection::Item d )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = locate( index );
if ( !n ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return FALSE;
@ -752,7 +750,7 @@ bool TQGList::replaceAt( uint index, TQPtrCollection::Item d )
deleteItem( n->data );
n->data = newItem( d );
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return TRUE;
@ -766,14 +764,14 @@ bool TQGList::replaceAt( uint index, TQPtrCollection::Item d )
TQPtrCollection::Item TQGList::takeNode( TQLNode *n )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
#if defined(QT_CHECK_NULL)
if ( n == 0 || (n->prev && n->prev->next != n) ||
(n->next && n->next->prev != n) ) {
tqWarning( "TQGList::takeNode: Corrupted node" );
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -785,7 +783,7 @@ TQPtrCollection::Item TQGList::takeNode( TQLNode *n )
delete n; // delete the node, not data
curNode = firstNode;
curIndex = curNode ? 0 : -1;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@ -797,13 +795,13 @@ TQPtrCollection::Item TQGList::takeNode( TQLNode *n )
TQPtrCollection::Item TQGList::take()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n; // delete node, keep contents
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@ -815,11 +813,11 @@ TQPtrCollection::Item TQGList::take()
TQPtrCollection::Item TQGList::takeAt( uint index )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( !locate(index) ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -827,7 +825,7 @@ TQPtrCollection::Item TQGList::takeAt( uint index )
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n; // delete node, keep contents
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@ -839,14 +837,14 @@ TQPtrCollection::Item TQGList::takeAt( uint index )
TQPtrCollection::Item TQGList::takeFirst()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
first();
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@ -858,14 +856,14 @@ TQPtrCollection::Item TQGList::takeFirst()
TQPtrCollection::Item TQGList::takeLast()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
last();
TQLNode *n = unlink(); // unlink node
Item d = n ? n->data : 0;
delete n;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return d;
@ -878,7 +876,7 @@ TQPtrCollection::Item TQGList::takeLast()
void TQGList::clear()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = firstNode;
@ -898,7 +896,7 @@ void TQGList::clear()
n = n->next;
delete prevNode; // deallocate node
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@ -911,7 +909,7 @@ void TQGList::clear()
int TQGList::findRef( TQPtrCollection::Item d, bool fromStart )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n;
@ -929,7 +927,7 @@ int TQGList::findRef( TQPtrCollection::Item d, bool fromStart )
}
curNode = n;
curIndex = n ? index : -1;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curIndex; // return position of item
@ -943,7 +941,7 @@ int TQGList::findRef( TQPtrCollection::Item d, bool fromStart )
int TQGList::find( TQPtrCollection::Item d, bool fromStart )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n;
@ -961,7 +959,7 @@ int TQGList::find( TQPtrCollection::Item d, bool fromStart )
}
curNode = n;
curIndex = n ? index : -1;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curIndex; // return position of item
@ -974,7 +972,7 @@ int TQGList::find( TQPtrCollection::Item d, bool fromStart )
uint TQGList::containsRef( TQPtrCollection::Item d ) const
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = firstNode;
@ -984,7 +982,7 @@ uint TQGList::containsRef( TQPtrCollection::Item d ) const
count++;
n = n->next;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return count;
@ -997,7 +995,7 @@ uint TQGList::containsRef( TQPtrCollection::Item d ) const
uint TQGList::contains( TQPtrCollection::Item d ) const
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode *n = firstNode;
@ -1008,7 +1006,7 @@ uint TQGList::contains( TQPtrCollection::Item d ) const
count++;
n = n->next;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return count;
@ -1058,17 +1056,17 @@ uint TQGList::contains( TQPtrCollection::Item d ) const
TQPtrCollection::Item TQGList::first()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( firstNode ) {
curIndex = 0;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return (curNode=firstNode)->data;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -1080,17 +1078,17 @@ TQPtrCollection::Item TQGList::first()
TQPtrCollection::Item TQGList::last()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( lastNode ) {
curIndex = numNodes-1;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return (curNode=lastNode)->data;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -1102,14 +1100,14 @@ TQPtrCollection::Item TQGList::last()
TQPtrCollection::Item TQGList::next()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( curNode ) {
if ( curNode->next ) {
curIndex++;
curNode = curNode->next;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode->data;
@ -1117,7 +1115,7 @@ TQPtrCollection::Item TQGList::next()
curIndex = -1;
curNode = 0;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -1129,14 +1127,14 @@ TQPtrCollection::Item TQGList::next()
TQPtrCollection::Item TQGList::prev()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
if ( curNode ) {
if ( curNode->prev ) {
curIndex--;
curNode = curNode->prev;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return curNode->data;
@ -1144,7 +1142,7 @@ TQPtrCollection::Item TQGList::prev()
curIndex = -1;
curNode = 0;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return 0;
@ -1157,12 +1155,12 @@ TQPtrCollection::Item TQGList::prev()
void TQGList::toVector( TQGVector *vector ) const
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
vector->clear();
if ( !vector->resize( count() ) ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return;
@ -1174,14 +1172,14 @@ void TQGList::toVector( TQGVector *vector ) const
n = n->next;
i++;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
void TQGList::heapSortPushDown( TQPtrCollection::Item* heap, int first, int last )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
int r = first;
@ -1218,7 +1216,7 @@ void TQGList::heapSortPushDown( TQPtrCollection::Item* heap, int first, int last
}
}
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@ -1233,12 +1231,12 @@ void TQGList::heapSortPushDown( TQPtrCollection::Item* heap, int first, int last
void TQGList::sort()
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
uint n = count();
if ( n < 2 ) {
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return;
@ -1273,7 +1271,7 @@ void TQGList::sort()
}
delete [] realheap;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
}
@ -1300,7 +1298,7 @@ TQDataStream &operator<<( TQDataStream &s, const TQGList &list )
TQDataStream &TQGList::read( TQDataStream &s )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
uint num;
@ -1326,7 +1324,7 @@ TQDataStream &TQGList::read( TQDataStream &s )
}
curNode = firstNode;
curIndex = curNode ? 0 : -1;
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return s;
@ -1338,7 +1336,7 @@ TQDataStream &TQGList::read( TQDataStream &s )
TQDataStream &TQGList::write( TQDataStream &s ) const
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
s << count(); // write number of items
@ -1347,7 +1345,7 @@ TQDataStream &TQGList::write( TQDataStream &s ) const
write( s, n->data );
n = n->next;
}
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return s;
@ -1361,13 +1359,13 @@ TQDataStream &TQGList::write( TQDataStream &s ) const
*/
TQLNode* TQGList::erase( TQLNode* it )
{
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->lock();
#endif
TQLNode* n = it;
it = it->next;
removeNode( n );
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
//mutex->unlock();
#endif
return it;

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

@ -3244,7 +3244,7 @@ TQString TQLocalePrivate::doubleToString(double d,
TQString digits;
#ifdef QT_QLOCALE_USES_FCVT
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
static bool dummy_for_mutex;
TQMutex *fcvt_mutex = tqt_global_mutexpool ? tqt_global_mutexpool->get( &dummy_for_mutex ) : 0;
# define FCVT_LOCK if (fcvt_mutex) fcvt_mutex->lock()

@ -40,7 +40,7 @@
#include "ntqglobal.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@ -534,4 +534,4 @@ int TQMutex::level()
\sa TQMutexLocker::TQMutexLocker()
*/
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD

@ -38,7 +38,7 @@
#include "qmutexpool_p.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#include <ntqthread.h>

@ -56,7 +56,7 @@
#include "ntqmemarray.h"
#endif // QT_H
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
class TQ_EXPORT TQMutexPool
{
@ -75,6 +75,6 @@ private:
extern TQ_EXPORT TQMutexPool *tqt_global_mutexpool;
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#endif // TQMUTEXPOOL_P_H

@ -52,10 +52,10 @@
#include "ntqstring.h"
#include "ntqtl.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#include "ntqthreadstorage.h"
#include <private/qthreadinstance_p.h>
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#undef TQT_TRANSLATE_NOOP
#define TQT_TRANSLATE_NOOP( context, sourceText ) sourceText
@ -3212,25 +3212,25 @@ struct TQRegExpPrivate
#ifndef TQT_NO_REGEXP_OPTIM
static TQSingleCleanupHandler<TQCache<TQRegExpEngine> > cleanup_cache;
# ifndef TQT_THREAD_SUPPORT
# ifdef TQT_NO_THREAD
static TQCache<TQRegExpEngine> *engineCache = 0;
# endif // TQT_THREAD_SUPPORT
# endif // TQT_NO_THREAD
#endif // TQT_NO_REGEXP_OPTIM
static void regexpEngine( TQRegExpEngine *&eng, const TQString &pattern,
bool caseSensitive, bool deref )
{
# ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
static TQThreadStorage<TQCache<TQRegExpEngine> *> engineCaches;
TQCache<TQRegExpEngine> *engineCache = 0;
TQThreadInstance *currentThread = TQThreadInstance::current();
if (currentThread)
engineCache = engineCaches.localData();
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
if ( !deref ) {
#ifndef TQT_NO_REGEXP_OPTIM
# ifdef TQT_THREAD_SUPPORT
# ifndef TQT_NO_THREAD
if ( currentThread )
# endif
{
@ -3251,18 +3251,18 @@ static void regexpEngine( TQRegExpEngine *&eng, const TQString &pattern,
if ( eng->deref() ) {
#ifndef TQT_NO_REGEXP_OPTIM
# ifdef TQT_THREAD_SUPPORT
# ifndef TQT_NO_THREAD
if ( currentThread )
# endif
{
if ( engineCache == 0 ) {
engineCache = new TQCache<TQRegExpEngine>;
engineCache->setAutoDelete( TRUE );
# ifdef TQT_THREAD_SUPPORT
# ifndef TQT_NO_THREAD
engineCaches.setLocalData(engineCache);
# else
cleanup_cache.set( &engineCache );
# endif // !TQT_THREAD_SUPPORT
# endif // TQT_NO_THREAD
}
if ( !pattern.isNull() &&
engineCache->insert(pattern, eng, 4 + pattern.length() / 4) )

@ -40,7 +40,7 @@
#include "ntqglobal.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#include "ntqsemaphore.h"
#include "ntqmutex.h"
@ -254,4 +254,4 @@ bool TQSemaphore::tryAccess(int n)
return TRUE;
}
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD

@ -93,9 +93,9 @@
#define ULLONG_MAX TQ_UINT64_C(18446744073709551615)
#endif
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
#include "ntqmutex.h"
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
extern TQMutex *tqt_sharedStringMutex;
@ -1054,9 +1054,9 @@ TQStringData::TQStringData() : TQShared(),
islatin1(FALSE),
security_unpaged(FALSE),
cString(0) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new TQMutex(FALSE);
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
ref();
}
@ -1069,9 +1069,9 @@ TQStringData::TQStringData(TQChar *u, uint l, uint m) : TQShared(),
islatin1(FALSE),
security_unpaged(FALSE),
cString(0) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
mutex = new TQMutex(FALSE);
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
TQStringData::~TQStringData() {
@ -1089,12 +1089,12 @@ TQStringData::~TQStringData() {
if (cString) {
delete cString;
}
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if ( mutex ) {
delete mutex;
mutex = NULL;
}
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
void TQStringData::setDirty() {
@ -1466,14 +1466,14 @@ const TQChar TQChar::nbsp((ushort)0x00a0);
TQStringData* TQString::makeSharedNull()
{
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if (TQString::shared_null) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
return TQString::shared_null;
}
@ -1483,9 +1483,9 @@ TQStringData* TQString::makeSharedNull()
that->d = TQString::shared_null;
#endif
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
if (tqt_sharedStringMutex) tqt_sharedStringMutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
return TQString::shared_null;
}
@ -1526,13 +1526,13 @@ TQString::TQString( const TQString &s ) :
d(s.d)
{
if ( d && (d != shared_null) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->ref();
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
@ -1685,20 +1685,20 @@ TQString::~TQString()
return;
}
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->deleteSelf();
d = NULL;
}
else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
@ -1720,22 +1720,22 @@ void TQString::real_detach()
void TQString::deref()
{
if ( d && (d != shared_null) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->deref() ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d != shared_null ) {
delete d;
}
d = 0;
}
else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
}
@ -1778,13 +1778,13 @@ void TQStringData::deleteSelf()
TQString &TQString::operator=( const TQString &s )
{
if ( s.d && (s.d != shared_null) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
s.d->ref();
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
s.d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
deref();
d = s.d;
@ -1892,9 +1892,9 @@ void TQString::truncate( uint newLen )
*/
void TQString::setLength( uint newLen )
{
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl ||
( newLen * 4 < d->maxl && d->maxl > 4 ) ) {
@ -1905,24 +1905,24 @@ void TQString::setLength( uint newLen )
uint len = TQMIN( d->len, newLen );
memcpy( nd, d->unicode, sizeof(TQChar) * len );
bool unpaged = d->security_unpaged;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
deref();
d = new TQStringData( nd, newLen, newMax );
setSecurityUnPaged(unpaged);
}
else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
}
else {
d->len = newLen;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
}
}
@ -2008,21 +2008,21 @@ void TQString::squeeze()
*/
void TQString::grow( uint newLen )
{
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || newLen > d->maxl ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
setLength( newLen );
}
else {
d->len = newLen;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
}
}
@ -6447,19 +6447,19 @@ TQString TQString::fromUcs2( const unsigned short *str )
*/
TQChar& TQString::ref(uint i) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( (d->count != 1) || (i >= d->len) ) {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
subat( i );
}
else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
d->setDirty();
return d->unicode[i];
@ -6547,9 +6547,9 @@ TQString& TQString::setUnicode( const TQChar *unicode, uint len )
}
}
else {
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count != 1 || len > d->maxl || ( len * 4 < d->maxl && d->maxl > 4 ) ) {
// detach, grown or shrink
uint newMax = computeNewMax( len );
@ -6557,17 +6557,17 @@ TQString& TQString::setUnicode( const TQChar *unicode, uint len )
if ( unicode ) {
memcpy( nd, unicode, sizeof(TQChar)*len );
}
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
deref();
d = new TQStringData( nd, len, newMax );
}
else {
d->len = len;
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
d->setDirty();
if ( unicode ) {
memcpy( d->unicode, unicode, sizeof(TQChar)*len );
@ -7278,9 +7278,9 @@ TQConstString::TQConstString( const TQChar* unicode, uint length ) :
*/
TQConstString::~TQConstString()
{
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->lock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
if ( d->count > 1 ) {
TQChar* cp = QT_ALLOC_QCHAR_VEC( d->len );
@ -7292,9 +7292,9 @@ TQConstString::~TQConstString()
}
// The original d->unicode is now unlinked.
#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE)
#if !defined(TQT_NO_THREAD) && defined(MAKE_QSTRING_THREAD_SAFE)
d->mutex->unlock();
#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE
#endif // !TQT_NO_THREAD && MAKE_QSTRING_THREAD_SAFE
}
/*!

@ -56,7 +56,7 @@
#include "ntqwindowdefs.h"
#endif // QT_H
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#ifdef Q_OS_UNIX
#include <pthread.h>
@ -105,5 +105,5 @@ public:
bool disableThreadPostedEvents : 1;
};
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD
#endif // TQTHREAD_P_H

@ -38,7 +38,7 @@
#include "ntqglobal.h"
#ifdef TQT_THREAD_SUPPORT
#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@ -348,4 +348,4 @@ void TQThreadStorageData::finish( void **thread_storage )
\sa localData() hasLocalData()
*/
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD

@ -40,7 +40,7 @@
#include "ntqglobal.h"
#if defined(TQT_THREAD_SUPPORT)
#ifndef TQT_NO_THREAD
#include "qplatformdefs.h"
@ -315,4 +315,4 @@ bool TQWaitCondition::wait(TQMutex *mutex, unsigned long time)
return (ret == 0);
}
#endif // TQT_THREAD_SUPPORT
#endif // TQT_NO_THREAD

Loading…
Cancel
Save