mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-04 15:36:35 +00:00
validate-scenario: Fix busy waiting, missing lock
execute_next_action_full() logs that it removes the source when an action returns ASYNC, but the code for that was incomplete, as it was setting source_id to zero but not actually removing the source. This lead to execute_next_action_full() being run continuously, only alliviated by the default 10ms interval in the GSource from `scenario->priv->action_execution_interval`. This patch fixes that. As a drive-by fix it also adds locking to one remaining unlocked usage of `priv->execute_actions_source_id`. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8014>
This commit is contained in:
parent
c683cdc914
commit
fbad7b593d
1 changed files with 3 additions and 1 deletions
|
@ -3210,7 +3210,7 @@ execute_action:
|
|||
priv->execute_actions_source_id = 0;
|
||||
SCENARIO_UNLOCK (scenario);
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
return G_SOURCE_REMOVE;
|
||||
case GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS:
|
||||
return G_SOURCE_CONTINUE;
|
||||
case GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING:
|
||||
|
@ -3572,10 +3572,12 @@ _execute_wait_for_message (GstValidateScenario * scenario,
|
|||
|
||||
gst_validate_printf (action, "Waiting for '%s' message\n", message_type);
|
||||
|
||||
SCENARIO_LOCK (scenario);
|
||||
if (priv->execute_actions_source_id) {
|
||||
g_source_remove (priv->execute_actions_source_id);
|
||||
priv->execute_actions_source_id = 0;
|
||||
}
|
||||
SCENARIO_UNLOCK (scenario);
|
||||
|
||||
g_assert (!priv->wait_message_action);
|
||||
priv->wait_message_action = gst_validate_action_ref (action);
|
||||
|
|
Loading…
Reference in a new issue