From ef0af3ca33a007f2aae2016cc27b6d828367c987 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Fri, 15 May 2009 05:50:09 +0000 Subject: io-threads: Add graceful shutdown of worker threads Signed-off-by: Anand V. Avati --- xlators/performance/io-threads/src/io-threads.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xlators/performance/io-threads/src/io-threads.h') diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h index f02109428..8075972b4 100644 --- a/xlators/performance/io-threads/src/io-threads.h +++ b/xlators/performance/io-threads/src/io-threads.h @@ -49,8 +49,11 @@ struct iot_request { call_stub_t *stub; }; -#define IOT_STATE_ACTIVE 1 -#define IOT_STATE_DEAD 2 +typedef enum { + IOT_STATE_ACTIVE, + IOT_STATE_EXIT_REQUEST, + IOT_STATE_DEAD +}iot_state_t; #define iot_worker_active(wrk) ((wrk)->state == IOT_STATE_ACTIVE) #define MAX_IDLE_SKEW 1000 /* usecs */ @@ -76,7 +79,7 @@ struct iot_worker { pthread_mutex_t qlock; int32_t queue_size; pthread_t thread; - int state; /* What state is the thread in. */ + iot_state_t state; /* What state is the thread in. */ int thread_idx; /* Thread's index into the worker array. Since this will be thread local data, for ensuring that -- cgit