diff options
Diffstat (limited to 'kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp')
-rw-r--r-- | kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp b/kxsldbg/kxsldbgpart/libqtnotfier/xsldbgthread.cpp index 1f428bb5..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_QUIT; + 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); @@ -272,7 +272,7 @@ int qtNotifyTextXsldbgApp(XsldbgMessageEnum type, const char *text) } char mainBuffer[DEBUG_BUFFER_SIZE]; -static void xsldbgThreadCleanupQt(void); +static void xsldbgThreadCleanupTQt(void); /* this is where the thread get to do all its work */ @@ -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 */ } @@ -301,9 +301,9 @@ xsldbgThreadMain(void *) } } */ - xsldbgSetThreadCleanupFunc(xsldbgThreadCleanupQt); - setThreadStatus(XSLDBG_MSG_THREAD_RUN); - setInputStatus(XSLDBG_MSG_AWAITING_INPUT); + xsldbgSetThreadCleanupFunc(xsldbgThreadCleanupTQt); + 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; } @@ -327,15 +327,15 @@ xsldbgThreadMain(void *) /* thread has died so cleanup after it not called directly but via notifyXsldbgApp*/ void -xsldbgThreadCleanupQt(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"); |