git: d0cf6f344404 - main - science/pulseview: fix crash on startup when libcxx has asserts enabled

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Fri, 21 Feb 2025 06:07:21 UTC
The branch main has been updated by avg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d0cf6f3444047de16dae99d6b05264014ab7813c

commit d0cf6f3444047de16dae99d6b05264014ab7813c
Author:     Andriy Gapon <avg@FreeBSD.org>
AuthorDate: 2025-02-17 09:48:37 +0000
Commit:     Andriy Gapon <avg@FreeBSD.org>
CommitDate: 2025-02-21 06:06:49 +0000

    science/pulseview: fix crash on startup when libcxx has asserts enabled
    
    The program's code unlocks a mutex that it never locked.
    When libcxx is built with debug (e.g., on stable branches) there is a
    crash on an assert that pthread_mutex_unlock succeeds.
    
    This change adds a patch for the problem.
    
    PR:             282727
    Approved by:    uzsolt
---
 science/pulseview/files/patch-pv_data_decodesignal.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/science/pulseview/files/patch-pv_data_decodesignal.cpp b/science/pulseview/files/patch-pv_data_decodesignal.cpp
new file mode 100644
index 000000000000..b4020899840e
--- /dev/null
+++ b/science/pulseview/files/patch-pv_data_decodesignal.cpp
@@ -0,0 +1,15 @@
+--- pv/data/decodesignal.cpp.orig	2020-03-31 23:41:18.000000000 +0300
++++ pv/data/decodesignal.cpp	2024-11-08 15:04:00.844432000 +0200
+@@ -251,11 +251,8 @@
+ 
+ void DecodeSignal::resume_decode()
+ {
+-	// Manual unlocking is done before notifying, to avoid waking up the
+-	// waiting thread only to block again (see notify_one for details)
+-	decode_pause_mutex_.unlock();
+-	decode_pause_cond_.notify_one();
+ 	decode_paused_ = false;
++	decode_pause_cond_.notify_one();
+ }
+ 
+ bool DecodeSignal::is_paused() const