diff options
author | Zhou Zhengping <johnzzpcrystal@gmail.com> | 2016-06-26 19:56:58 -0400 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-07-09 06:50:31 -0700 |
commit | 693eccd456c4fc7dfadb72069da906544cf19733 (patch) | |
tree | ace3705b6ada28d89e770df6fce538061f48503d /libglusterfs/src/timer.h | |
parent | 9886d568a7a8839bf3acc81cb1111fa372ac5270 (diff) |
libglusterfs: race condition when set ctx->timer in function gf_timer_registry_init
1.fix race conditon when set ctx->timer
2.use typical list_head operation instead of verbose list's operation
3.add file "tags" into .gitignore
Signed-off-by: Zhou Zhengping <johnzzpcrystal@gmail.com>
Change-Id: I4ec55e41356633cf1399536d202c58e19b309f00
BUG: 1350191
Reviewed-on: http://review.gluster.org/14800
Smoke: Gluster Build System <jenkins@build.gluster.org>
Tested-by: Zhou Zhengping <johnzzpcrystal@gmail.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs/src/timer.h')
-rw-r--r-- | libglusterfs/src/timer.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libglusterfs/src/timer.h b/libglusterfs/src/timer.h index 0224b0897f9..32b246cf00d 100644 --- a/libglusterfs/src/timer.h +++ b/libglusterfs/src/timer.h @@ -19,7 +19,13 @@ typedef void (*gf_timer_cbk_t) (void *); struct _gf_timer { - struct _gf_timer *next, *prev; + union { + struct list_head list; + struct { + struct _gf_timer *next; + struct _gf_timer *prev; + }; + }; struct timespec at; gf_timer_cbk_t callbk; void *data; @@ -30,7 +36,7 @@ struct _gf_timer { struct _gf_timer_registry { pthread_t th; char fin; - struct _gf_timer active; + struct list_head active; gf_lock_t lock; }; |