summaryrefslogtreecommitdiffstats
path: root/runtime/wtp.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-17 18:40:28 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-17 18:40:28 +0200
commit4c9eded44dbae1701bb3b8f255865892b19e7f72 (patch)
tree0610fa71ff86cba87cce2e1c6c36df26c854ae0b /runtime/wtp.h
parent183b49015561890e148a50128c051a1cdd4491b9 (diff)
downloadrsyslog-4c9eded44dbae1701bb3b8f255865892b19e7f72.tar.gz
rsyslog-4c9eded44dbae1701bb3b8f255865892b19e7f72.tar.xz
rsyslog-4c9eded44dbae1701bb3b8f255865892b19e7f72.zip
further code simplification
... could even remove one mutex by using a better algorithm. I think I also spotted some situation in which a hang could have happened. As I can't fix it in v4 and less without moving to the new engine, I make no effort in testing this out. Hangs occur during shutdown, only (if at all). The code changes should also result in some mild performance improvement. Some bug potential, but overall the bug potential should have been greatly reduced.
Diffstat (limited to 'runtime/wtp.h')
-rw-r--r--runtime/wtp.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/runtime/wtp.h b/runtime/wtp.h
index c933f337..cff6d3f9 100644
--- a/runtime/wtp.h
+++ b/runtime/wtp.h
@@ -27,16 +27,9 @@
#include <pthread.h>
#include "obj.h"
-/* commands and states for worker threads. */
-typedef enum {
- eWRKTHRD_STOPPED = 0, /* worker thread is not running (either actually never ran or was shut down) */
- /* ALL active states MUST be numerically higher than eWRKTHRD_TERMINATED and NONE must be lower! */
- eWRKTHRD_RUN_CREATED = 2,/* worker thread has been created, but is not fully running (prob. not yet scheduled) */
- eWRKTHRD_RUNNING = 4, /* worker thread is up and running and shall continue to do so */
- eWRKTHRD_SHUTDOWN = 5, /* worker thread is running but shall terminate when wtp is empty */
- eWRKTHRD_SHUTDOWN_IMMEDIATE = 6/* worker thread is running but shall terminate even if wtp is full */
- /* SHUTDOWN_IMMEDIATE MUST always be the numerically highest state! */
-} qWrkCmd_t;
+/* states for worker threads. */
+#define WRKTHRD_STOPPED FALSE
+#define WRKTHRD_RUNNING TRUE
/* possible states of a worker thread pool */