Automated update from Qt3

pull/1/head
Timothy Pearson 12 years ago
parent 9ee8babab3
commit eb47d241d0

3
configure vendored

@ -734,6 +734,9 @@ while [ "$#" -gt 0 ]; do
glibmainloop) glibmainloop)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_GLIBMAINLOOP="$VAL" CFG_GLIBMAINLOOP="$VAL"
if [ "$VAL" = "yes" ]; then
echo "WARNING: glib main loop support is ***incomplete*** and will cause problems with threaded applications and/or those using non-standard event loops!"
fi
else else
UNKNOWN_OPT=yes UNKNOWN_OPT=yes
fi fi

@ -2767,18 +2767,21 @@ bool TQApplication::internalNotify( TQObject *receiver, TQEvent * e)
if (!handled) { if (!handled) {
#if defined(QT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
bool locked = false; int locklevel = 0;
int llcount;
if (TQApplication::tqt_mutex) { if (TQApplication::tqt_mutex) {
locked = TQApplication::tqt_mutex->locked(); TQApplication::tqt_mutex->lock(); // 1 of 2
} locklevel = tqt_mutex->level() - 1;
if (locked) { for (llcount=0; llcount<locklevel; llcount++) {
TQApplication::tqt_mutex->unlock(); TQApplication::tqt_mutex->unlock();
} }
TQApplication::tqt_mutex->unlock(); // 2 of 2
}
#endif #endif
consumed = receiver->event( e ); consumed = receiver->event( e );
#if defined(QT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
if (locked) {
if (TQApplication::tqt_mutex) { if (TQApplication::tqt_mutex) {
for (llcount=0; llcount<locklevel; llcount++) {
TQApplication::tqt_mutex->lock(); TQApplication::tqt_mutex->lock();
} }
} }

@ -54,6 +54,8 @@
#include <glib.h> #include <glib.h>
// #define DEBUG_QT_GLIBMAINLOOP 1
// TQt-GSource Structure and Callbacks // TQt-GSource Structure and Callbacks
typedef struct { typedef struct {
@ -595,12 +597,16 @@ bool TQEventLoop::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(QT_THREAD_SUPPORT)
locker.mutex()->unlock();
#endif
processX11Events(); processX11Events();
} }
else {
#if defined(QT_THREAD_SUPPORT) #if defined(QT_THREAD_SUPPORT)
locker.mutex()->unlock(); locker.mutex()->unlock();
#endif #endif
}
if (d->singletoolkit) { if (d->singletoolkit) {
return TRUE; // Eat the event return TRUE; // Eat the event

@ -74,6 +74,9 @@ private:
TQMutex( const TQMutex & ); TQMutex( const TQMutex & );
TQMutex &operator=( const TQMutex & ); TQMutex &operator=( const TQMutex & );
#endif #endif
public:
int level();
}; };
class Q_EXPORT TQMutexLocker class Q_EXPORT TQMutexLocker

@ -67,6 +67,7 @@ public:
virtual bool locked() = 0; virtual bool locked() = 0;
virtual bool trylock() = 0; virtual bool trylock() = 0;
virtual int type() const = 0; virtual int type() const = 0;
virtual int level() = 0;
}; };

@ -85,6 +85,7 @@ public:
bool locked(); bool locked();
bool trylock(); bool trylock();
int type() const; int type() const;
int level();
bool recursive; bool recursive;
}; };
@ -101,6 +102,7 @@ public:
bool locked(); bool locked();
bool trylock(); bool trylock();
int type() const; int type() const;
int level();
int count; int count;
unsigned long owner; unsigned long owner;
@ -196,6 +198,11 @@ int TQRealMutexPrivate::type() const
return recursive ? Q_MUTEX_RECURSIVE : Q_MUTEX_NORMAL; return recursive ? Q_MUTEX_RECURSIVE : Q_MUTEX_NORMAL;
} }
int TQRealMutexPrivate::level()
{
return locked();
}
#ifndef Q_RECURSIVE_MUTEX_TYPE #ifndef Q_RECURSIVE_MUTEX_TYPE
TQRecursiveMutexPrivate::TQRecursiveMutexPrivate() TQRecursiveMutexPrivate::TQRecursiveMutexPrivate()
@ -329,6 +336,11 @@ int TQRecursiveMutexPrivate::type() const
return Q_MUTEX_RECURSIVE; return Q_MUTEX_RECURSIVE;
} }
int TQRecursiveMutexPrivate::level()
{
return count;
}
#endif // !Q_RECURSIVE_MUTEX_TYPE #endif // !Q_RECURSIVE_MUTEX_TYPE
@ -510,6 +522,22 @@ bool TQMutex::tryLock()
return d->trylock(); return d->trylock();
} }
/*!
Returns the current lock level of the mutex.
0 means the mutex is unlocked
This method should only be called when the mutex has already been locked
by lock(), otherwise the lock level could change before the next line
of code is executed.
WARNING: Non-recursive mutexes will never exceed a lock level of 1!
\sa lock(), unlock(), locked()
*/
int TQMutex::level()
{
return d->level();
}
/*! /*!
\class TQMutexLocker ntqmutex.h \class TQMutexLocker ntqmutex.h
\brief The TQMutexLocker class simplifies locking and unlocking TQMutexes. \brief The TQMutexLocker class simplifies locking and unlocking TQMutexes.

Loading…
Cancel
Save