summaryrefslogtreecommitdiffstats
path: root/server/parser/threadinfo.h
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-10-19 18:41:27 +0200
committerDavid Sommerseth <davids@redhat.com>2009-10-19 18:41:27 +0200
commit5fff332a9aad904fbe85d3a022cd15f9dad5e6ba (patch)
treefd37e1a95e52869e3da133db13a84a57bbd87389 /server/parser/threadinfo.h
parenta2a7d6034e3b823bdf3b4aaa36a4a0ab87951b5c (diff)
downloadrteval-5fff332a9aad904fbe85d3a022cd15f9dad5e6ba.tar.gz
rteval-5fff332a9aad904fbe85d3a022cd15f9dad5e6ba.tar.xz
rteval-5fff332a9aad904fbe85d3a022cd15f9dad5e6ba.zip
Big rewrite, but now a working rteval_parserd process is ready
Need to add daemonizing mode, add proper logging and fix all FIXME's in the code
Diffstat (limited to 'server/parser/threadinfo.h')
-rw-r--r--server/parser/threadinfo.h30
1 files changed, 7 insertions, 23 deletions
diff --git a/server/parser/threadinfo.h b/server/parser/threadinfo.h
index 76d6972..8eb27b0 100644
--- a/server/parser/threadinfo.h
+++ b/server/parser/threadinfo.h
@@ -23,35 +23,19 @@
#ifndef _THREADINFO_H
#define _THREADINFO_H
-#include <pgsql.h>
+#include <mqueue.h>
#include <libxslt/transform.h>
/**
- * States for the thread slots, also used to identify if the main program
- * can assign a new job to a thread or not.
- *
- */
-typedef enum { thrREADY, /**< Set by main() - thread slot is ready for a job */
- thrSTARTED, /**< Set by main() - thread slot is assigned to a running thread*/
- thrRUNNING, /**< Set by parsethread() - thread started running */
- thrCOMPLETE, /**< Set by parsethread() on success - thread completed */
- thrFAIL /**< Set by parsethread() on failure - thread completed */
-} threadState;
-
-
-/**
* Thread slot information. Each thread slot is assigned with one threadData_t element.
- *
*/
typedef struct {
- threadState status; /**< State of the current thread */
- pthread_mutex_t *mtx_sysreg; /**< Mutex locking, to avoid clashes with registering systems */
- unsigned int id; /**< Numeric ID for this thread */
- dbconn *dbc; /**< Database connection assigned to this thread */
- xsltStylesheet *xslt; /**< XSLT stylesheet assigned to this thread */
-
- unsigned int submid; /**< Work info: Numeric ID of the job being parsed */
- const char *filename; /**< Work info: Full filename of the report to be parsed*/
+ int *shutdown; /**< If set to 1, the thread should shut down */
+ mqd_t msgq; /**< POSIX MQ descriptor */
+ pthread_mutex_t *mtx_sysreg; /**< Mutex locking, to avoid clashes with registering systems */
+ unsigned int id; /**< Numeric ID for this thread */
+ dbconn *dbc; /**< Database connection assigned to this thread */
+ xsltStylesheet *xslt; /**< XSLT stylesheet assigned to this thread */
} threadData_t;
#endif