summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-02-22 15:20:52 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-02-22 15:20:52 +0100
commit7de0f46028e964bd7b7979835ef0a80cf8cb01b7 (patch)
tree297ad74ff359a0b6975794e37c89764bd5ec5905 /tracker-pt/ftnoir_tracker_pt.cpp
parent388e9e57d8dcc1b5eda16670bae0e4518515504c (diff)
video/widget: fix mutex starvation
Get rid of contention in `preview_size' and `set_image'. After switching the Qt mutex to non-recursive, turns out the writer thread preempts the UI thread to the point of freezing the entire thing. Mutex fairness is an implementation detail and we must assume unfair mutexes in the worst case.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index a1a0dc1c..a2272d1c 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -101,8 +101,7 @@ void Tracker_PT::run()
widget->update_image(preview_frame->get_bitmap());
{
- int w = -1, h = -1;
- widget->get_preview_size(w, h);
+ auto [ w, h ] = widget->preview_size();
if (w != preview_width || h != preview_height)
{
preview_width = w; preview_height = h;