diff options
author | Raghavendra G <raghavendra@zresearch.com> | 2009-05-15 05:50:09 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-05-20 11:37:37 -0700 |
commit | ef0af3ca33a007f2aae2016cc27b6d828367c987 (patch) | |
tree | bb9757c246237b317213f26c3727aa303a4782ae /xlators/performance/io-threads/src/io-threads.h | |
parent | c22810911149506d972133c4e87dbcab01330daa (diff) |
io-threads: Add graceful shutdown of worker threads
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.h')
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h index f0210942854..8075972b455 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 |