summaryrefslogtreecommitdiffstats
path: root/src/kvilib/system/kvi_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvilib/system/kvi_thread.cpp')
-rw-r--r--src/kvilib/system/kvi_thread.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/kvilib/system/kvi_thread.cpp b/src/kvilib/system/kvi_thread.cpp
index 02dcdc09..306f6c75 100644
--- a/src/kvilib/system/kvi_thread.cpp
+++ b/src/kvilib/system/kvi_thread.cpp
@@ -99,7 +99,7 @@ static void kvi_threadIgnoreSigalarm()
ignr_act.sa_flags |= SA_RESTART;
#endif
- if(sigaction(SIGALRM,&ignr_act,0) == -1)debug("Failed to set SIG_IGN for SIGALRM.");
+ if(sigaction(SIGALRM,&ignr_act,0) == -1)tqDebug("Failed to set SIG_IGN for SIGALRM.");
#endif
#endif
}
@@ -108,7 +108,7 @@ static void kvi_threadIgnoreSigalarm()
static void kvi_threadSigpipeHandler(int)
{
- debug("Thread ????: Caught SIGPIPE: ignoring.");
+ tqDebug("Thread ????: Caught SIGPIPE: ignoring.");
}
#endif
@@ -133,7 +133,7 @@ static void kvi_threadCatchSigpipe()
act.sa_flags |= SA_RESTART;
#endif
- if(sigaction(SIGPIPE,&act,0L) == -1)debug("Failed to set the handler for SIGPIPE.");
+ if(sigaction(SIGPIPE,&act,0L) == -1)tqDebug("Failed to set the handler for SIGPIPE.");
#endif
}
@@ -171,7 +171,7 @@ void KviThreadManager::globalDestroy()
KviThreadManager::KviThreadManager()
: TQObject()
{
- if(g_pThreadManager)debug("Hey...what are ya doing ?");
+ if(g_pThreadManager)tqDebug("Hey...what are ya doing ?");
m_pMutex = new KviMutex();
@@ -189,17 +189,17 @@ KviThreadManager::KviThreadManager()
if(pipe(m_fd) != 0)
{
- debug("Ops...thread manager pipe creation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
+ tqDebug("Ops...thread manager pipe creation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
}
if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_SLAVE],F_SETFL,O_NONBLOCK) == -1)
{
- debug("Ops...thread manager slave pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
+ tqDebug("Ops...thread manager slave pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
}
if(fcntl(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],F_SETFL,O_NONBLOCK) == -1)
{
- debug("Ops...thread manager master pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
+ tqDebug("Ops...thread manager master pipe initialisation failed (%s)",KviTQString::toUtf8(KviError::getDescription(KviError::translateSystemError(errno))).data());
}
m_pSn = new TQSocketNotifier(m_fd[KVI_THREAD_PIPE_SIDE_MASTER],TQSocketNotifier::Read);
@@ -349,7 +349,7 @@ void KviThreadManager::postSlaveEvent(TQObject *o,TQEvent *e)
{
// ops.. failed to write down the event..
// this is quite irritating now...
- debug("Ops.. failed to write down the trigger");
+ tqDebug("Ops.. failed to write down the trigger");
// FIXME: maybe a single shot timer ?
} else {
m_iTriggerCount++;
@@ -421,7 +421,7 @@ void KviThreadManager::threadLeftWaitState()
m_iWaitingThreads--;
if(m_iWaitingThreads < 0)
{
- debug("Ops.. got a negative number of waiting threads ?");
+ tqDebug("Ops.. got a negative number of waiting threads ?");
m_iWaitingThreads = 0;
}
m_pMutex->unlock();
@@ -462,11 +462,11 @@ KviThread::KviThread()
KviThread::~KviThread()
{
-// debug(">> KviThread::~KviThread() : (this = %d)",this);
+// tqDebug(">> KviThread::~KviThread() : (this = %d)",this);
wait();
delete m_pRunningMutex;
g_pThreadManager->unregisterSlaveThread(this);
-// debug("<< KviThread::~KviThread() : (this = %d)",this);
+// tqDebug("<< KviThread::~KviThread() : (this = %d)",this);
}
void KviThread::setRunning(bool bRunning)
@@ -512,16 +512,16 @@ bool KviThread::start()
void KviThread::wait()
{
// We're on the master side here...and we're waiting the slave to exit
-// debug(">> KviThread::wait() (this=%d)",this);
+// tqDebug(">> KviThread::wait() (this=%d)",this);
while(isStartingUp())usleep(500); // sleep 500 microseconds
-// debug("!! KviThread::wait() (this=%d)",this);
+// tqDebug("!! KviThread::wait() (this=%d)",this);
g_pThreadManager->threadEnteredWaitState();
while(isRunning())
{
usleep(500); // sleep 500 microseconds
}
g_pThreadManager->threadLeftWaitState();
-// debug("<< KviThread::wait() (this=%d)",this);
+// tqDebug("<< KviThread::wait() (this=%d)",this);
}
void KviThread::exit()
@@ -534,13 +534,13 @@ void KviThread::exit()
void KviThread::internalThreadRun_doNotTouchThis()
{
// we're on the slave thread here!
-// debug(">> KviThread::internalRun (this=%d)",this);
+// tqDebug(">> KviThread::internalRun (this=%d)",this);
setRunning(true);
setStartingUp(false);
kvi_threadInitialize();
run();
setRunning(false);
-// debug("<< KviThread::internalRun (this=%d",this);
+// tqDebug("<< KviThread::internalRun (this=%d",this);
}
void KviThread::usleep(unsigned long usec)
@@ -592,9 +592,9 @@ KviSensitiveThread::KviSensitiveThread()
KviSensitiveThread::~KviSensitiveThread()
{
-// debug("Entering KviSensitiveThread::~KviSensitiveThread (this=%d)",this);
+// tqDebug("Entering KviSensitiveThread::~KviSensitiveThread (this=%d)",this);
terminate();
-// debug("KviSensitiveThread::~KviSensitiveThread : terminate called (This=%d)",this);
+// tqDebug("KviSensitiveThread::~KviSensitiveThread : terminate called (This=%d)",this);
m_pLocalEventQueueMutex->lock();
m_pLocalEventQueue->setAutoDelete(true);
delete m_pLocalEventQueue;
@@ -602,12 +602,12 @@ KviSensitiveThread::~KviSensitiveThread()
m_pLocalEventQueueMutex->unlock();
delete m_pLocalEventQueueMutex;
m_pLocalEventQueueMutex = 0;
-// debug("Exiting KviSensitiveThread::~KviSensitiveThread (this=%d)",this);
+// tqDebug("Exiting KviSensitiveThread::~KviSensitiveThread (this=%d)",this);
}
void KviSensitiveThread::enqueueEvent(KviThreadEvent *e)
{
-// debug(">>> KviSensitiveThread::enqueueEvent() (this=%d)",this);
+// tqDebug(">>> KviSensitiveThread::enqueueEvent() (this=%d)",this);
m_pLocalEventQueueMutex->lock();
if(!m_pLocalEventQueue)
{
@@ -618,27 +618,27 @@ void KviSensitiveThread::enqueueEvent(KviThreadEvent *e)
}
m_pLocalEventQueue->append(e);
m_pLocalEventQueueMutex->unlock();
-// debug("<<< KviSensitiveThread::enqueueEvent() (this=%d)",this);
+// tqDebug("<<< KviSensitiveThread::enqueueEvent() (this=%d)",this);
}
KviThreadEvent * KviSensitiveThread::dequeueEvent()
{
-// debug(">>> KviSensitiveThread::dequeueEvent() (this=%d)",this);
+// tqDebug(">>> KviSensitiveThread::dequeueEvent() (this=%d)",this);
KviThreadEvent * ret;
m_pLocalEventQueueMutex->lock();
ret = m_pLocalEventQueue->first();
if(ret)m_pLocalEventQueue->removeFirst();
m_pLocalEventQueueMutex->unlock();
-// debug("<<< KviSensitiveThread::dequeueEvent() (this=%d)",this);
+// tqDebug("<<< KviSensitiveThread::dequeueEvent() (this=%d)",this);
return ret;
}
void KviSensitiveThread::terminate()
{
-// debug("Entering KviSensitiveThread::terminate (this=%d)",this);
+// tqDebug("Entering KviSensitiveThread::terminate (this=%d)",this);
enqueueEvent(new KviThreadEvent(KVI_THREAD_EVENT_TERMINATE));
-// debug("KviSensitiveThread::terminate() : event enqueued waiting (this=%d)",this);
+// tqDebug("KviSensitiveThread::terminate() : event enqueued waiting (this=%d)",this);
wait();
-// debug("Exiting KviSensitiveThread::terminate (this=%d)",this);
+// tqDebug("Exiting KviSensitiveThread::terminate (this=%d)",this);
}