You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/08/25 13:04:04 UTC
[GitHub] [qpid-dispatch] ChugR commented on a change in pull request #1349: DISPATCH-2238: release the action mutex before waking core thread
ChugR commented on a change in pull request #1349:
URL: https://github.com/apache/qpid-dispatch/pull/1349#discussion_r695728502
##########
File path: src/router_core/router_core_thread.c
##########
@@ -174,37 +174,11 @@ void qdr_adaptors_finalize(qdr_core_t *core)
}
-/*
- * router_core_process_background_action_LH
- *
- * Process up to one available background action.
- * Return true iff an action was processed.
- */
-static bool router_core_process_background_action_LH(qdr_core_t *core)
-{
- qdr_action_t *action = DEQ_HEAD(core->action_list_background);
-
- if (!!action) {
- DEQ_REMOVE_HEAD(core->action_list_background);
- sys_mutex_unlock(core->action_lock);
- if (action->label)
- qd_log(core->log, QD_LOG_TRACE, "Core background action '%s'%s", action->label, core->running ? "" : " (discard)");
- action->action_handler(core, action, !core->running);
- sys_mutex_lock(core->action_lock);
-
- free_qdr_action_t(action);
- return true;
- }
-
- return false;
-}
-
-
void *router_core_thread(void *arg)
{
qdr_core_t *core = (qdr_core_t*) arg;
qdr_action_list_t action_list;
Review comment:
Where is action list initialized?
##########
File path: src/router_core/router_core_thread.c
##########
@@ -213,25 +187,48 @@ void *router_core_thread(void *arg)
//
sys_mutex_lock(core->action_lock);
- //
- // Block on the condition variable when there is no action to do
- //
- while (core->running && DEQ_IS_EMPTY(core->action_list)) {
- if (!router_core_process_background_action_LH(core))
- sys_cond_wait(core->action_cond, core->action_lock);
+ for (;;) {
+ if (!DEQ_IS_EMPTY(core->action_list)) {
Review comment:
This loop could initialize local action list with:
DEQ_MOVE(core->action_list, action_list);
if (!DEQ_IS_EMPTY(action_list) {
break;
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org