https://bugs.kde.org/show_bug.cgi?id=489169

Jakob Petsovits <jpe...@petsovits.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas
                   |ma/powerdevil/-/commit/7e11 |ma/powerdevil/-/commit/2097
                   |30ffcf7ad667272dabf83451522 |82d50796d8aa2bfe36753c69ed6
                   |36a38bf2a                   |c77ec5c99

--- Comment #10 from Jakob Petsovits <jpe...@petsovits.com> ---
Git commit 209782d50796d8aa2bfe36753c69ed6c77ec5c99 by Jakob Petsovits.
Committed on 02/07/2024 at 12:06.
Pushed by jpetso into branch 'Plasma/6.1'.

daemon/controllers: Reintroduce a mutex around ddca_open_display2()

ddcutil keeps some global state, and in particular we've seen a
crash in ddc_close_display() related to its open_displays hashmap.

One likely culprit for such a crash is that brightness workers run
on separate threads, one per DDCutilDisplay object, so they
could get executed simultaneously when more than one external
monitor is involved.

A less likely, but still possible culprit is when a DDCutilDisplay
constructor opens a display handle at the same time that a
brightness worker sets the brightness of a different display
on a different thread.

We could look into combining all brightness setter calls into
a single BrightnessWorker that gets shared across DDCutilDisplay
objects, but this would introduce extra complexity and still
wouldn't address the constructor vs. brightness setter issue.

So this commit reintroduces a mutex to isolate all of these usages
from each other. We had one in 5.x, which was removed in 6.0 at my
(in hindsight incorrect) request:
https://invent.kde.org/plasma/powerdevil/-/merge_requests/312#note_865976,
https://invent.kde.org/plasma/powerdevil/-/merge_requests/312#note_867942


(cherry picked from commit 7e1130ffcf7ad667272dabf8345152236a38bf2a)

Co-authored-by: Jakob Petsovits <jpe...@petsovits.com>

M  +5    -1    daemon/controllers/ddcutildetector.cpp
M  +41   -30   daemon/controllers/ddcutildisplay.cpp
M  +3    -1    daemon/controllers/ddcutildisplay.h

https://invent.kde.org/plasma/powerdevil/-/commit/209782d50796d8aa2bfe36753c69ed6c77ec5c99

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to