This is an automated email from the ASF dual-hosted git repository. aconway pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
commit 077710c72a20f854e9fe0cbcd983ba68c4d72d10 Author: Alan Conway <acon...@redhat.com> AuthorDate: Fri Mar 1 14:42:38 2019 -0500 DISPATCH-1274: Separate qd_timer_t lock from server qd_timer_t was sharing a lock with qd_server_t for historical reasons. Code inspection shows there is no need for the sharing. - timer.c calls qd_server_timeout() which is thread-safe, and no other server functions. - timer calls handlers outside the lock so it doesn't mater what lock is used. --- src/server.c | 2 +- src/timer.c | 5 +++-- src/timer_private.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server.c b/src/server.c index 1863546..760126d 100644 --- a/src/server.c +++ b/src/server.c @@ -1227,7 +1227,7 @@ qd_server_t *qd_server(qd_dispatch_t *qd, int thread_count, const char *containe qd_server->cond = sys_cond(); DEQ_INIT(qd_server->conn_list); - qd_timer_initialize(qd_server->lock); + qd_timer_initialize(); qd_server->pause_requests = 0; qd_server->threads_paused = 0; diff --git a/src/timer.c b/src/timer.c index 0fd87c7..c76f77d 100644 --- a/src/timer.c +++ b/src/timer.c @@ -182,10 +182,10 @@ void qd_timer_cancel(qd_timer_t *timer) //========================================================================= -void qd_timer_initialize(sys_mutex_t *server_lock) +void qd_timer_initialize() { qd_immediate_initialize(); - lock = server_lock; + lock = sys_mutex(); DEQ_INIT(idle_timers); DEQ_INIT(scheduled_timers); time_base = 0; @@ -194,6 +194,7 @@ void qd_timer_initialize(sys_mutex_t *server_lock) void qd_timer_finalize(void) { + sys_mutex_free(lock); lock = 0; qd_immediate_finalize(); } diff --git a/src/timer_private.h b/src/timer_private.h index 263fca5..9f6f1cb 100644 --- a/src/timer_private.h +++ b/src/timer_private.h @@ -36,7 +36,7 @@ struct qd_timer_t { DEQ_DECLARE(qd_timer_t, qd_timer_list_t); -void qd_timer_initialize(sys_mutex_t *server_lock); +void qd_timer_initialize(void); void qd_timer_finalize(void); void qd_timer_visit(); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org