File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -128,3 +128,26 @@ void two_custom_mutex_bases_casts_tn(MyMutex &m) {
128
128
sleep (10 );
129
129
}
130
130
131
+ struct MutexVirtBase1 : virtual std::mutex {
132
+ void lock1 () { lock (); }
133
+ void unlock1 () { unlock (); }
134
+ };
135
+
136
+ struct MutexVirtBase2 : virtual std::mutex {
137
+ void lock2 () { lock (); }
138
+ void unlock2 () { unlock (); }
139
+ };
140
+
141
+ struct CombinedVirtMutex : MutexVirtBase1, MutexVirtBase2 {};
142
+
143
+ void virt_inherited_mutexes_same_base_tn1 (CombinedVirtMutex &cvt) {
144
+ cvt.lock1 ();
145
+ cvt.unlock1 ();
146
+ sleep (10 );
147
+ }
148
+
149
+ void virt_inherited_mutexes_different_bases_tn (CombinedVirtMutex &cvt) {
150
+ cvt.lock1 ();
151
+ cvt.unlock2 (); // Despite a different name, unlock2 acts on the same mutex as lock1
152
+ sleep (10 );
153
+ }
You can’t perform that action at this time.
0 commit comments