summaryrefslogtreecommitdiffstats
path: root/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp')
-rw-r--r--kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp b/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp
index 4fe2e02c..1f997919 100644
--- a/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp
+++ b/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp
@@ -83,7 +83,7 @@ xsldbgThreadInit(void)
int result = 0;
fprintf(stderr, "mainInit()\n");
xsltSetGenericErrorFunc(0, xsldbgGenericErrorFunc);
- setThreadStatus(XSLDBG_MSG_THREAD_INIT);
+ setThreadtqStatus(XSLDBG_MSG_THREAD_INIT);
xsldbgSetAppFunc(qtNotifyXsldbgApp);
xsldbgSetAppStateFunc(qtNotifyStateXsldbgApp);
xsldbgSetTextFunc(qtNotifyTextXsldbgApp);
@@ -94,12 +94,12 @@ xsldbgThreadInit(void)
if (pthread_create(&mythread, NULL, xsldbgThreadMain, NULL) != EAGAIN) {
int counter;
for (counter = 0; counter < 11; counter++){
- if (getThreadStatus() != XSLDBG_MSG_THREAD_INIT)
+ if (getThreadtqStatus() != XSLDBG_MSG_THREAD_INIT)
break;
usleep(250000); /*guess that it will take at most 2.5 seconds to startup */
}
/* xsldbg should have started by now if it can */
- if (getThreadStatus() == XSLDBG_MSG_THREAD_RUN){
+ if (getThreadtqStatus() == XSLDBG_MSG_THREAD_RUN){
fprintf(stderr, "Created thread\n");
result++;
}else
@@ -117,13 +117,13 @@ void
xsldbgThreadFree(void)
{
fprintf(stderr, "xsldbgThreadFree()\n");
- if (getThreadStatus() != XSLDBG_MSG_THREAD_DEAD)
+ if (getThreadtqStatus() != XSLDBG_MSG_THREAD_DEAD)
{
int counter;
fprintf(stderr, "Killing xsldbg thread\n");
- setThreadStatus(XSLDBG_MSG_THREAD_STOP);
+ setThreadtqStatus(XSLDBG_MSG_THREAD_STOP);
for (counter = 0; counter < 11; counter++){
- if (getThreadStatus() == XSLDBG_MSG_THREAD_DEAD)
+ if (getThreadtqStatus() == XSLDBG_MSG_THREAD_DEAD)
break;
usleep(250000); /*guess that it will take at most 2.5 seconds to stop */
}
@@ -143,7 +143,7 @@ fakeInput(const char *text)
{
int result = 0;
- if (!text || (getInputReady() == 1) || (getThreadStatus() != XSLDBG_MSG_THREAD_RUN))
+ if (!text || (getInputReady() == 1) || (getThreadtqStatus() != XSLDBG_MSG_THREAD_RUN))
return result;
// fprintf(stderr, "\nFaking input of \"%s\"\n", text);
@@ -172,7 +172,7 @@ qtXslDbgShellReadline(xmlChar * prompt)
static char last_read[DEBUG_BUFFER_SIZE] = { '\0' };
- if (getThreadStatus() != XSLDBG_MSG_THREAD_RUN)
+ if (getThreadtqStatus() != XSLDBG_MSG_THREAD_RUN)
{
#ifdef HAVE_READLINE
xmlChar *line_read;
@@ -209,20 +209,20 @@ qtXslDbgShellReadline(xmlChar * prompt)
}
else{
- setInputStatus(XSLDBG_MSG_AWAITING_INPUT);
+ setInputtqStatus(XSLDBG_MSG_AWAITING_INPUT);
notifyXsldbgApp(XSLDBG_MSG_AWAITING_INPUT, NULL);
while (getInputReady() == 0){
usleep(10000);
/* have we been told to die */
- if (getThreadStatus() == XSLDBG_MSG_THREAD_STOP){
+ if (getThreadtqStatus() == XSLDBG_MSG_THREAD_STOP){
fprintf(stderr, "About to stop thread\n");
xslDebugStatus = DEBUG_TQUIT;
return NULL;
}
}
- setInputStatus(XSLDBG_MSG_READ_INPUT);
+ setInputtqStatus(XSLDBG_MSG_READ_INPUT);
inputReadBuff = getFakeInput();
if(inputReadBuff){
notifyXsldbgApp(XSLDBG_MSG_READ_INPUT, inputReadBuff);
@@ -283,7 +283,7 @@ xsldbgThreadMain(void *)
// char *defaultArgv[2];
// int i;
- if (getThreadStatus() != XSLDBG_MSG_THREAD_INIT){
+ if (getThreadtqStatus() != XSLDBG_MSG_THREAD_INIT){
fprintf(stderr, "xsldbg thread is not ready to be started. Or one is already running.\n");
return NULL; /* we can't start more than one thread of xsldbg */
}
@@ -302,8 +302,8 @@ xsldbgThreadMain(void *)
}
*/
xsldbgSetThreadCleanupFunc(xsldbgThreadCleanupTQt);
- setThreadStatus(XSLDBG_MSG_THREAD_RUN);
- setInputStatus(XSLDBG_MSG_AWAITING_INPUT);
+ setThreadtqStatus(XSLDBG_MSG_THREAD_RUN);
+ setInputtqStatus(XSLDBG_MSG_AWAITING_INPUT);
fprintf(stderr, "Starting thread\n");
/* call the "main of xsldbg" found in debugXSL.c */
@@ -316,8 +316,8 @@ xsldbgThreadMain(void *)
}
*/
- setThreadStatus(XSLDBG_MSG_THREAD_DEAD);
- setInputStatus(XSLDBG_MSG_PROCESSING_INPUT);
+ setThreadtqStatus(XSLDBG_MSG_THREAD_DEAD);
+ setInputtqStatus(XSLDBG_MSG_PROCESSING_INPUT);
notifyXsldbgApp(XSLDBG_MSG_THREAD_DEAD, NULL);
return NULL;
}
@@ -330,12 +330,12 @@ void
xsldbgThreadCleanupTQt(void)
{
fprintf(stderr, "Thread has finished\n");
- if (getThreadStatus() == XSLDBG_MSG_THREAD_RUN)
+ if (getThreadtqStatus() == XSLDBG_MSG_THREAD_RUN)
{
xsldbgThreadFree();
}
- /* its safe to modify threadStatus as the thread is now dead */
- setThreadStatus(XSLDBG_MSG_THREAD_DEAD);
+ /* its safe to modify threadtqStatus as the thread is now dead */
+ setThreadtqStatus(XSLDBG_MSG_THREAD_DEAD);
}
@@ -346,7 +346,7 @@ xsldbgThreadStdoutReader(void *data)
if (!stdoutIO)
return data;
- while (getThreadStatus() == XSLDBG_MSG_THREAD_RUN){
+ while (getThreadtqStatus() == XSLDBG_MSG_THREAD_RUN){
if (fgets(outputBuffer, sizeof(outputBuffer -1), stdoutIO)){
usleep(10000);
strcat(outputBuffer, "\n");