Skip to content

UI: Stop locking filter mutex while loading properties#5759

Merged
jp9000 merged 1 commit into
obsproject:masterfrom
exeldro:properties_deadlock
Jan 9, 2022
Merged

UI: Stop locking filter mutex while loading properties#5759
jp9000 merged 1 commit into
obsproject:masterfrom
exeldro:properties_deadlock

Conversation

@exeldro
Copy link
Copy Markdown
Contributor

@exeldro exeldro commented Jan 8, 2022

Description

Reordering the filters makes the filter mutex of the source locked while loading a new the properties of a filter which may require other locks. By loading the properties of the filter on a QueuedConnection we make sure the filter mutex is cleared when that happens.

Motivation and Context

I don't like deadlocks.
The main UI thread gets a lock on the filter mutex followed by a lock on the app sources mutex to fill the properties of the filter
while the graphics thread does a lock on the app sources mutex followed by a lock on the filter mutex

How Has This Been Tested?

On windows 64 bit by reordering move transition override filters

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added the kind/bug Categorizes issue or PR as related to a bug. label Jan 8, 2022
Reordering the filters makes the filter mutex of the source locked
while loading a new the properties of a filter which may require other
locks. By loading the properties of the filter on a QueuedConnection
we make sure the filter mutex is cleared when that happens.
@exeldro exeldro force-pushed the properties_deadlock branch from eab130e to e832262 Compare January 8, 2022 18:16
@WizardCM
Copy link
Copy Markdown
Member

WizardCM commented Jan 8, 2022

Is this a new issue in the beta, or slightly more longer-standing?

@jp9000 jp9000 merged commit ae4797f into obsproject:master Jan 9, 2022
@RytoEX RytoEX added this to the OBS Studio 27.2 milestone Jan 9, 2022
@exeldro exeldro deleted the properties_deadlock branch June 15, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug.

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

4 participants