gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / seq24-rename-mutex.patch
1 The custom mutex definition in Seq24 clashes with the mutex defined in gtkmm.
2 This patch renames the custom definition.
3
4 See https://bugs.launchpad.net/seq24/+bug/1647614 for upstream bug report.
5
6 diff --git a/src/midibus.h b/src/midibus.h
7 index 2cdf8e8..1bb02bd 100644
8 --- a/src/midibus.h
9 +++ b/src/midibus.h
10 @@ -90,7 +90,7 @@ class midibus
11
12
13 /* locking */
14 - mutex m_mutex;
15 + seq24mutex m_mutex;
16
17 /* mutex */
18 void lock();
19 @@ -208,7 +208,7 @@ class mastermidibus
20 sequence *m_seq;
21
22 /* locking */
23 - mutex m_mutex;
24 + seq24mutex m_mutex;
25
26 /* mutex */
27 void lock();
28 diff --git a/src/midibus_portmidi.h b/src/midibus_portmidi.h
29 index 0119e9c..8c6a27a 100644
30 --- a/src/midibus_portmidi.h
31 +++ b/src/midibus_portmidi.h
32 @@ -65,7 +65,7 @@ class midibus
33 long m_lasttick;
34
35 /* locking */
36 - mutex m_mutex;
37 + seq24mutex m_mutex;
38
39 /* mutex */
40 void lock();
41 @@ -164,7 +164,7 @@ class mastermidibus
42 sequence *m_seq;
43
44 /* locking */
45 - mutex m_mutex;
46 + seq24mutex m_mutex;
47
48 /* mutex */
49 void lock();
50 diff --git a/src/mutex.cpp b/src/mutex.cpp
51 index b3f23fd..914114f 100644
52 --- a/src/mutex.cpp
53 +++ b/src/mutex.cpp
54 @@ -20,23 +20,23 @@
55
56 #include "mutex.h"
57
58 -const pthread_mutex_t mutex::recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
59 +const pthread_mutex_t seq24mutex::recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
60 const pthread_cond_t condition_var::cond = PTHREAD_COND_INITIALIZER;
61
62 -mutex::mutex( )
63 +seq24mutex::seq24mutex( )
64 {
65 m_mutex_lock = recmutex;
66 }
67
68 void
69 -mutex::lock( )
70 +seq24mutex::lock( )
71 {
72 pthread_mutex_lock( &m_mutex_lock );
73 }
74
75
76 void
77 -mutex::unlock( )
78 +seq24mutex::unlock( )
79 {
80 pthread_mutex_unlock( &m_mutex_lock );
81 }
82 diff --git a/src/mutex.h b/src/mutex.h
83 index 399f8a3..4f1b867 100644
84 --- a/src/mutex.h
85 +++ b/src/mutex.h
86 @@ -24,7 +24,7 @@
87
88 #include <pthread.h>
89
90 -class mutex {
91 +class seq24mutex {
92
93 private:
94
95 @@ -37,14 +37,14 @@ protected:
96
97 public:
98
99 - mutex();
100 + seq24mutex();
101
102 void lock();
103 void unlock();
104
105 };
106
107 -class condition_var : public mutex {
108 +class condition_var : public seq24mutex {
109
110 private:
111
112 diff --git a/src/sequence.h b/src/sequence.h
113 index 2943946..9da8700 100644
114 --- a/src/sequence.h
115 +++ b/src/sequence.h
116 @@ -153,7 +153,7 @@ class sequence
117 long m_rec_vol;
118
119 /* locking */
120 - mutex m_mutex;
121 + seq24mutex m_mutex;
122
123 /* used to idenfity which events are ours in the out queue */
124 //unsigned char m_tag;